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: reading brokerproperties in _create_message throws ValueError #192

Closed
russellneufeld opened this issue Aug 18, 2014 · 1 comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention This issue is responsible by Azure service team. Service Bus

Comments

@russellneufeld
Copy link

Line 258 of azure/servicebus/init.py is:

broker_properties = ast.literal_eval(value)

This line often throws ValueError because the 'value' it's trying to eval is not value python (it's valid json).

Here's an example of a value coming from the broker properties from an Azure Service Bus message:

{"DeliveryCount":4,"EnqueuedTimeUtc":"Tue, 15 Apr 2014 20:52:34 GMT","ForcePersistence":false,"LockToken":"9b946475-8e67-4f60-8499-8a4c5cbb7bfc","LockedUntilUtc":"Mon, 18 Aug 2014 08:17:05 GMT","MessageId":"7014fa25dc8c418bb90312de1251d8a5","SequenceNumber":562975,"State":"Active","TimeToLive":604800}

Notice that ForcePersistence is "false", not "False". This causes ast.literal_eval to fail.

This is a pretty serious bug as valid messages appear to be unreadable by the python azure sdk. One suggested fix would be to replace line 258 with

broker_properties = json.loads(value)

That seems to work fine.

huguesv added a commit that referenced this issue Aug 18, 2014
#192 Fix deserialization of broker properties for service bus.
@huguesv
Copy link
Contributor

huguesv commented Aug 26, 2014

Fixed in 0.8.2

@huguesv huguesv closed this as completed Aug 26, 2014
@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Service Attention This issue is responsible by Azure service team. Service Bus
Projects
None yet
Development

No branches or pull requests

3 participants