Service Bus: reading brokerproperties in _create_message throws ValueError #192
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
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.
The text was updated successfully, but these errors were encountered: