Azure / azure-servicebus-jms

Azure ServiceBus client using QPID for JMS users
MIT License
6 stars 5 forks source link

Cannot use Topic Level SAS based Connection Strings to consume messages coming to an existing subscription #33

Closed hilmij closed 1 year ago

hilmij commented 1 year ago

Hi, I am trying to implement a message consumer, for this, I am using a Connection String generated in Shared Access Policies (Topic Level) with Listen (I also tried the Manage) claims, but the application is failing indicating an invalid token error. Then I tried the same with Connection String generated in Shared Access Policies (Namespace Level) with Manage claims, and without any issues, I was able to consume the messages.

I am using the following code to create the consumer:

JMSConsumer consumer = context.createSharedDurableConsumer(topic, SUBSCRIPTION_NAME);

I am not setting a ClientId and trying to use an existing Subscription created from a Terraform project.

Am I missing something here? Am I able to use the Topic Level Connection Strings? Please let me know.

Thanks, Hilmi.