4
votes

I use the sample from this url http://azure.microsoft.com/en-us/documentation/articles/service-bus-java-how-to-use-jms-api-amqp/. I have 2 questions:

1. ACS or SAS

The connection URL,

amqps://[username]:[password]@[namespace].servicebus.windows.net

The username and password is from ACS authentication, but Azure Service Bus has changed its auth from ACS to SAS. Does it also support SAS auth? Like username is SAS policy, password is SAS policy's key.

2. Running throw Exception

Even I use ACS (if I create namespace with powershell, it's still ACS) or SAS, when running the sample code from http://azure.microsoft.com/en-us/documentation/articles/service-bus-java-how-to-use-jms-api-amqp/, they all throw an exception and failed.

Exception:"org.apache.qpid.amqp_1_0.client.Sender$SenderCreationException:
Peer did not create remote endpoint for link". 

Is there any way to fix this problem?

By the way, which I connect is not Service Bus for windows(on-premise), it's for Azure Service Bus(Cloud). Thanks.

2

2 Answers

2
votes

RE: 1. ACS or SAS

Yes, you can use SAS with AMQP. Policy name instead of username, and URL encoded key instead password. The URL encoding is required to handle any non-alphanumeric characters in key value as +, /, or =.

The URL format is:

amqps://<policyname>:<urlencoded(key)>@<namespace>.servicebus.windows.net

RE: 2. Running throw Exception

Make sure your queue does not have partitioning enabled. ServiceBus does not support AMQP with partitioned queues, however queues are created with partitioning enabled by default.

I had this exact same error, and re-creating the queue with "Enable Partitioning" unchecked solved it for me.

See the Partitioned Entities Limitations section at the bottom of this article: https://msdn.microsoft.com/en-us/library/azure/dn520246.aspx

Partitioned queues and topics are only available via SBMP or HTTP/HTTPS. AMQP support will be added in the future.

0
votes

Just to be sure, did you create "queue1" named queue inside service bus namespace. From you tutorial :

This guide assumes that you already have a Service Bus namespace containing a queue named "queue1."

Paolo