Search code examples
javaserviceazurebus

Using Azure Service Bus in java


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?


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”.