-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ServiceBus] Add optional boolean skipParsingBodyAsJson
option
#18692
[ServiceBus] Add optional boolean skipParsingBodyAsJson
option
#18692
Conversation
to `ReceiveMessagesOptions`, `SubscribeOptions`, and `ServiceBusSessionReceiverOptions`. This allows users to control whether the SDK should skip parsing message body as Json object. By default the SDK will attempt parsing message body as Json object. While updating code, I also fixed sample unit test which is using out-dated paths thus not finding any sample code files, and removed two `await` that are redundant. Resolves Azure#18630
I wonder whether we should make this a property of ServiceBusClientOptions instead |
API changes have been detected in API changes + skipParsingBodyAsJson?: boolean;
+ skipParsingBodyAsJson?: boolean;
+ skipParsingBodyAsJson?: boolean; |
/azp run js - service-bus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Since it only applies to receiving side, I wouldnt put it in the ServiceBusclientOptions. |
to `ServiceBusReceiverOptions` and remove those on `ReceiveMessagesOptions` and `SubscribeOptions`
yeah that makes more sense! Updated in last commit |
API changes have been detected in API changes + skipParsingBodyAsJson?: boolean;
+ skipParsingBodyAsJson?: boolean; |
// this.body = undefined; | ||
// } | ||
// } | ||
// why above when `fromRheaMessage()` already called `defaultDataTransformer.decodeWithType()` earlier on message body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you sync with @richardpark-msft about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @richardpark-msft and we agreed that this code was doing double-decoding. So deleting.
but the message body is already decoded, and _rawAmqpMessage is assigned in `fromRheaMessage()`
/azp run js - service-bus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an entry to the changelog?
|
||
message.body = defaultDataTransformer.decode(message.body); | ||
message.body = defaultDataTransformer.decode( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is existing code, but can you check if we even need this step? Shouldnt fromRheaMessage()
already call defaultDataTransformer.decode()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, it feels like we should not have this option for management client, and should always either try or skip?
message.body has been decoded already above by `fromRheaMessage()` call.
…o sb/option-skip-json-parsing
API changes have been detected in API changes + skipParsingBodyAsJson?: boolean;
+ skipParsingBodyAsJson?: boolean; |
Co-authored-by: Deyaaeldeen Almahallawi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
Update changes.json (Azure#18692)
to
ServiceBusReceiverOptions
andServiceBusSessionReceiverOptions
. This allows users to controlwhether the SDK should skip parsing message body as Json object. By
default, the SDK will attempt parsing message body as Json object.
While updating code, I also fixed sample unit test which is using
out-dated paths thus not finding any sample code files, and removed
two
await
that are redundant.Resolves #18630