我正在尝试订阅java中的Azure服务总线主题.为此,我需要创建一个ServiceBusContract实例.在我发现的每个例子中,他们这样做:
String issuer = "<obtained from portal>";
String key = "<obtained from portal>";
Configuration config =
ServiceBusConfiguration.configureWithWrapAuthentication(
“HowToSample”,
issuer,
key);
ServiceBusContract service = ServiceBusService.create(config);
来自:link
但是,如果你看一下javadoc,就没有带有3个String参数的configureWithWrapAuthentication方法!
我正在使用天蓝色api的0.3.1版本的jar.
如何使用这些新的(?)configureWithWrapAuthentication方法创建ServiceBusContract?还是有一些我忽略的东西?
解决方法:
以下是我们在配置方法中包含的参数.
String namespace,namespace是服务总线订阅的名称,例如johndoeservicebus.
String authenticationName,authentication name是WRAP的登录名,通常称为owner.
字符串authenticationPassword,身份验证密码是您可以从Azure门户获取的密钥.
字符串serviceBusRootUri,服务总线根URI是服务总线服务的根,对于美国,它是“.servicebus.windows.net”.
String wrapRootUri,WRAP root Uri是WRAP身份验证服务的根,在美国,它是“-sb.accesscontrol.windows.net/WRAPv0.9”.