【问题标题】:Connecting to Azure ServiceBus Queue连接到 Azure ServiceBus 队列
【发布时间】:2013-02-08 21:26:41
【问题描述】:

我正在开发我的第一个 Azure 实现,我已经设置了我的 azure 帐户并使用 NuGet 将正确的 DLL 和配置安装到我的应用程序。当我将 WCF 客户端设置为指向服务总线队列并运行该方法时,我得到了这个异常:

Microsoft.ServiceBus.ServerErrorException

   at Microsoft.ServiceBus.RelayedSocketInitiator.Connect(Uri uri, TimeSpan timeout)
   at Microsoft.ServiceBus.ConnectivityModeConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   at Microsoft.ServiceBus.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
   at Microsoft.ServiceBus.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at Microsoft.ServiceBus.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at Microsoft.ServiceBus.Channels.LayeredChannel`1.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

我的端点配置是:

<endpoint address="sb://MyService.servicebus.windows.net/MyServicequeue"
                binding="netTcpRelayBinding" contract="PaperlessImportServiceWCF.PaperlessImportServiceSoap"
                name="MyServiceServiceSoap"  behaviorConfiguration="sbTokenProvider"/>

我的endpoint 行为是:

错误消息非常笼统,我不确定我应该首先查看什么

【问题讨论】:

    标签: azure servicebus azureservicebus


    【解决方案1】:

    我认为您对中继服务的工作方式存在一些误解。从您显示的配置中,您使用的是 NetTcpRelayBinding,它用于请求重放连接。但是,在您的端点中,您似乎使用队列地址作为端点。

    a) 如果您打算以请求-回复方式使用您的服务/客户端,那么您需要创建一个服务总线中继端点,并在您的端点中使用该地址。 This tutorial 是此服务总线功能的良好起点。

    b) 如果你打算使用队列,那么你需要 NetMessagingBinding。 This post 是了解如何执行上述场景的一个很好的起点。

    无论哪种情况,您似乎都使用了错误的基地址。 'myservice' 是您的服务总线命名空间的名称吗?如果不是,那么您应该将其替换为您的命名空间的名称。基本服务总线地址的格式为:protocol://YOUR_NAMESPACE.servicebus.windows.net

    【讨论】:

    • myservice 不是我用 MyNamespace 替换了我的真实名称空间。是的,我想做 b)。谢谢,我会看看,看看我能做什么。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多