qpid proton url用于接收来自给定订阅(主题)的消息

时间:2017-07-19 08:38:28

标签: python azureservicebus azure-servicebus-queues qpid azure-servicebus-topics

我想阅读服务总线的订阅消息。我正在使用qpid-proton库来进行python。我正在关注此链接以接收消息Proton-Python-Example-Simple-Receive。我正在传递此URL以接收来自服务总线的消息 -

url = 'amqps://mynamespace.servicebus.windows.net/SharedAccessKeyName=xxxx/SharedAccessKey=xxxxxxxxx/python-test/Subscriptions/AllMessages'
# python-test is the name of the topic
# AllMessages is the name of the subscription

我收到以下错误 - ERROR:root:The messaging entity 'sb://mynamespace.servicebus.windows.net/sharedaccesskeyname=xxxxx/sharedaccesskey=xxxxxxxxxxxxx/python-test/subscriptions/allmessages' could not be found. TrackingId:c1e4a39edbd44040b2fd48a552d6ae2b_G2, SystemTracker:gateway6, Timestamp:7/19/2017 7:58:51 AM

这是因为上述URL未正确形成。我在网上搜索过,在这方面没有提供适当的文件。通过qpid读取订阅消息的正确URL格式是什么。

1 个答案:

答案 0 :(得分:0)

请尝试更改您的网址,如下所示。

amqps://<SAS Policy Name>:<SharedAccessKey>@mynamespace.servicebus.windows.net/python-test/Subscriptions/AllMessages

enter image description here