8

I would like to read subscription messages from service bus. I am using qpid-proton library for python. I am following this link to receive messages Proton-Python-Example-Simple-Receive. I am passing this url to receive messages from service bus -

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

I am getting the following error - 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

This is due to fact that the above URL is not formed correctly. I have searched over the net and no proper documentation is provided in this respect. What will be the correct URL format to read subscription messages through qpid.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Anurag Sharma
  • 4,839
  • 13
  • 59
  • 101

1 Answers1

0

Please try to change your url as below.

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

enter image description here

Peter Pan
  • 23,476
  • 4
  • 25
  • 43
  • my actual url is 'amqps://All:Dj8/JPib+RKJS4haixxxxxxxxx@eventservice.servicebus.windows.net/job/Subscriptions/Create'. It throws an error "ValueError: Not a valid port number or service name: 'Dj8' ". I think its a problem with my shared access key because it contains a "/" character – Anurag Sharma Jul 28 '17 at 07:57
  • @AnuragSharma Please regenerate your shared access key without the symbol `/` to try again. Per my experience, I think the issue was caused by the amqp url parser cannot parse the url correctly. – Peter Pan Jul 28 '17 at 08:07
  • PaterPan - I am now receiving this error - 'Listen' claim(s) are required to perform this operation. – Anurag Sharma Aug 01 '17 at 10:21