在Java中使用Azure的服务总线 [英] Using Azure Service Bus in java

查看:225
本文介绍了在Java中使用Azure的服务总线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想订阅在Java中的Azure服务总线话题。要做到这一点,我需要创建一个ServiceBusContract实例。在每一个例子中,我发现,他们这样做是这样的:

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);

从:<一href=\"https://www.windowsazure.com/en-us/develop/java/how-to-guides/service-bus-topics/\">link

然而,如果你看一看的<一个href=\"http://dl.windowsazure.com/javadoc/com/microsoft/windowsazure/services/serviceBus/ServiceBusConfiguration.html\">javadoc,有3个字符串参数没有configureWithWrapAuthentication方法!

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

我使用的蔚蓝API的版本0.3.1罐子。

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

如何创建使用这些新的(?)configureWithWrapAuthentication方法ServiceBusContract?或者是有什么我忽略了?

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

推荐答案

下面是我们包括在配置方法的参数。

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

字符串命名,命名空间是您的服务总线认购,如johndoeservicebus的名称。
串authenticationName,认证名称是登录的WRAP,通常情况下,它被称为所有者的名称。
串authenticationPassword,验证密码是你可以从你的Azure门户网站获取的关键。
串serviceBusRootUri,服务总线根URI是服务总线服务的根,对于美国,这是.servicebus.windows.net。
串wrapRootUri,WRAP根URI是WRAP认证服务的根,在美国,它是-sb.accesscontrol.windows.net/WRAPv0.9。

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

这篇关于在Java中使用Azure的服务总线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆