Question

I'm trying to subscribe to an Azure service bus topic in java. To do that, I need to create a ServiceBusContract instance. In every example I found, they do it like this:

String issuer = "<obtained from portal>";
String key = "<obtained from portal>";
Configuration config = 
ServiceBusConfiguration.configureWithWrapAuthentication(
    “HowToSample”,
    issuer,
    key);  
ServiceBusContract service = ServiceBusService.create(config);

from: link

However if you take a look at the javadoc, there is no configureWithWrapAuthentication method with 3 String parameters!

I'm using the 0.3.1 version jar of the azure api.

How do I create a ServiceBusContract using these new(?) configureWithWrapAuthentication methods? Or is there something I overlooked?

Was it helpful?

Solution

Here are the parameters that we included in the configuration method.

String namespace, namespace is the name of your service bus subscription, such as johndoeservicebus. String authenticationName, authentication name is the name of the login for WRAP, typically, it is called owner. String authenticationPassword, authentication password is the key which you can obtain from your Azure Portal. String serviceBusRootUri, service bus root URI is the root of the service bus service, for united states, it is “.servicebus.windows.net”. String wrapRootUri, WRAP root Uri is the root of the WRAP authentication service, in united states, it is “-sb.accesscontrol.windows.net/WRAPv0.9”.

OTHER TIPS

Apprently there is an issue with the above, tried it and it no longer works. According to github there is an open issue now:

https://github.com/Azure/azure-sdk-for-java/issues/437

The team has triaged this issue and worked on it. We've also reached out to the service bus team on the change from ACS to SAS, and to our documentation team so that we have a full-stop plan for dealing with this change, as it's not just a code issue, it's a communication issue.

This fix will be in the next release of the Java SDK, based on everything I'm hearing from the team.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top