Using Azure Service Bus in java

I am trying to subscribe to the Azure Service Bus Bus topic in java. To do this, I need to create an instance of ServiceBusContract. In each 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 look at javadoc , there is no configureWithWrapAuthentication method with three String parameters!

I am using a jar of version 0.3.1 for the azure api.

How to create a ServiceBusContract using these new (?) ConfigureWithWrapAuthentication methods? Or is there something I forgot?

+4
source share
3 answers

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

The string namespace, namespace is the name of your service bus subscription, for example, johndoeservicebus. String authenticationName, authentication name is the login name for WRAP, usually called owner. String authenticationPassword, an authentication password is a key that you can get from your Azure Portal. The string service BusRootUri, the service bus root URI is the root of the service bus service, for the USA it is ".servicebus.windows.net". String wrapRootUri, WRAP root Uri is the root of the WRAP authentication service, in the United States it is “-sb.accesscontrol.windows.net/WRAPv0.9”.

+4
source

Apparently there is a problem with the above, tried it and it no longer works. According to github, there is now an open question:

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

+1
source

The team dealt with this problem and worked on it. We also contacted the service bus team about the transition from ACS to SAS and our documentation group so that we had a complete plan to solve this change, since this is not just a problem with the code, this message is a question.

This fix will be in the next version of the Java SDK, based on everything I hear from the team.

0
source

Source: https://habr.com/ru/post/1441150/


All Articles