Skip to content
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

[Service Bus] Add skipParsingBodyAsJson client option to disable attempting to parse message body as Json #18630

Closed
jeremymeng opened this issue Nov 10, 2021 · 0 comments · Fixed by #18692
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus

Comments

@jeremymeng
Copy link
Member

We've done it for Event Hubs in PR #18173. This tracks similar work for Service Bus.

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Service Bus labels Nov 10, 2021
@jeremymeng jeremymeng added this to the [2021] December milestone Nov 10, 2021
@jeremymeng jeremymeng self-assigned this Nov 10, 2021
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Nov 16, 2021
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
jeremymeng added a commit that referenced this issue Dec 10, 2021
)

* [ServiceBus] Add optional boolean `skipParsingBodyAsJson` option

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 #18630

* Add optional `skipParsingBodyAsJson` boolean property

to `ServiceBusReceiverOptions` and remove those on `ReceiveMessagesOptions` and
`SubscribeOptions`

* Remove commented code that was trying to decode again

but the message body is already decoded, and _rawAmqpMessage is assigned in
`fromRheaMessage()`

* Remove double decoding

message.body has been decoded already above by `fromRheaMessage()` call.

* Update CHANGELOG and package version

* Add comments

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant