[ServiceBus] Message body allows dictionary but can't receive the message #14500
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
feature-request
This issue requires a new behavior in the product in order be resolved.
Service Bus
Milestone
Describe the bug
According to the docs azure.servicebus.Message can accept string or bytes as body but by mistake I sent a dictionary without converting to string or bytes, the message was sent but I was not able to receive message on the other end. I spent a lot of time thinking my code was wrong on the other side cause I see there is a message active in the service bus.
Later I realized the error is because I sent the body without converting to string or bytes. Is there a way we could check for the type when creating the message?
To Reproduce
Following is example code which resulted in message getting stuck in the servicebus.
dict_test = {
"test1": "",
"test2": {
"test3": "",
"test4": "",
"test5":"westus2",
"test6": "2020-09-24"
},
}
message = Message(dict_test)
Expected behavior
Should not allow message body to be other type than string or bytes
The text was updated successfully, but these errors were encountered: