【问题标题】:How to read message from windows server service bus using wcf?如何使用 wcf 从 Windows 服务器服务总线读取消息?
【发布时间】:2015-05-15 00:11:15
【问题描述】:

我正在使用

在 Windows 服务器服务总线上发布 xml
    BrokeredMessage message = new BrokeredMessage("Xml as string");      

尝试在 wcf 服务中读取如下

    //System.ServiceModel.Channels.Message
    public void TopicReader(Message message) 
            {

            }

配置设置为

     <bindings>
     <netMessagingBinding>
            <binding name="messagingBinding" closeTimeout="00:03:00" openTimeout="00:03:00"
                   receiveTimeout="00:03:00" sendTimeout="00:03:00" sessionIdleTimeout="00:01:00"
                   prefetchCount="-1">
              <transportSettings batchFlushInterval="00:00:01" />
            </binding>
          </netMessagingBinding>
        </bindings>
        <behaviors>
          <endpointBehaviors>
            <behavior name="securityBehavior">
              <transportClientEndpointBehavior>
                <tokenProvider>

                  <windowsAuthentication>
                    <stsUris>
                      <stsUri value="https://MahindeName/Namespace" />

                    </stsUris>
                  </windowsAuthentication>
                </tokenProvider>
              </transportClientEndpointBehavior>

            </behavior>

端点名称="TopicReader" listenUri="sb://MahindeName/Namespace/TopicName/subscriptions/Sub" address="sb://MahindeName/Namespace/TopicName" binding="netMessagingBinding" bindingConfiguration="messagingBinding" contract="Service.ITopicReader" behaviorConfiguration="securityBehavior"

服务正在托管,没有任何错误,但我们无法接收消息并且传递计数正在增加。

【问题讨论】:

    标签: wcf wcf-binding azureservicebus


    【解决方案1】:

    根据我的经验,在接收发生之前,您需要做好很多事情。我的建议是也尝试使用 WCF 发布,一旦您能够通过 wcf 成功发布,那么该配置也适合接收。

    【讨论】:

      猜你喜欢
      • 2022-07-03
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 2020-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多