Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将消息转发到Nservicebus中的远程端点_Nservicebus - Fatal编程技术网

将消息转发到Nservicebus中的远程端点

将消息转发到Nservicebus中的远程端点,nservicebus,Nservicebus,在我的消息发布者配置中,我有 <MsmqTransportConfig InputQueue="EnformMessages" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" /> <UnicastBusConfig ForwardReceivedMessagesTo="testqueue@cgy1-web01"> <MessageEn

在我的消息发布者配置中,我有

 <MsmqTransportConfig
    InputQueue="EnformMessages"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
  />
    <UnicastBusConfig ForwardReceivedMessagesTo="testqueue@cgy1-web01">
       <MessageEndpointMappings>
       <!-- publishers don't need to set this for their own message types -->
       </MessageEndpointMappings>
     </UnicastBusConfig>

我希望它能将发布到EnformMessages的消息复制到远程机器上的队列中。虽然消息肯定是在本地接收的,但似乎从未向远程计算机发送任何消息。远程侦听器的配置文件如下所示

<MsmqTransportConfig
  InputQueue="worker"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

  <UnicastBusConfig>
    <MessageEndpointMappings>

      <add Messages="EnformMessages" Endpoint="testqueue" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

.  所以我的发布服务器配置看起来像

<MsmqTransportConfig
    InputQueue="client"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
  />

  <UnicastBusConfig
    DistributorControlAddress=""
    DistributorDataAddress=""
    ForwardReceivedMessagesTo="">

    <MessageEndpointMappings>
      <!-- publishers don't need to set this for their own message types -->
      <add Messages="EnformMessages" Endpoint="distributordatabus@cgy1-web01" />
      </MessageEndpointMappings>
  </UnicastBusConfig>

订阅服务器配置类似

<MsmqTransportConfig
  InputQueue="EnformMessages"
  ErrorQueue="error"
  NumberOfWorkerThreads="1"
  MaxRetries="5"
  />

  <UnicastBusConfig
    DistributorControlAddress="distributorcontrolbus@cgy1-web01"

      DistributorDataAddress="distributordatabus@cgy1-web01">
    <MessageEndpointMappings>

      <!--<add Messages="EnformMessages" Endpoint="EnformMessages" />-->
    </MessageEndpointMappings>
  </UnicastBusConfig>

和分销商一样

<appSettings>
    <add key="NumberOfWorkerThreads" value="1"/>

    <add key="DataInputQueue" value="distributorDataBus"/>
    <add key="ControlInputQueue" value="distributorControlBus"/>
    <add key="ErrorQueue" value="error"/>
    <add key="StorageQueue" value="distributorStorage"/>

    <add key="NameSpace" value="http://www.UdiDahan.com"/> 
    <!-- relevant for a Serialization of "interfaces" or "xml" -->

    <add key="Serialization" value="xml"/>
    <!-- can be either "xml", or "binary" -->
  </appSettings>


  <MsmqTransportConfig
 InputQueue="distributorControlBus"
 ErrorQueue="error"
 NumberOfWorkerThreads="1"
 MaxRetries="5"
  />

  <UnicastBusConfig >
    <MessageEndpointMappings >

      <add Messages="EnformMessages" Endpoint="EnformMessages" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

似乎没有收到任何消息。事实上,分销商根本没有打印任何内容。我在配置文件中添加了一个日志部分,希望它能产生一些输出,但什么也没有得到


Nservicebus 2.0.0.768在发布/订阅场景中,将消息转发到审核队列的是订阅者,而不是发布者。另外,您告诉订阅者它的发布者是“testqueue”,但您将发布者的输入队列指定为“EnformMessages”。这两个队列需要匹配。

第一件事-升级到RTM:-)啊,这是个好主意。我已经做了很多,并且回到了本地pub/sub工作的地方,因此ForwardReceivedMessageTo实际上只是用于审核,不应该用我尝试的方式来分发消息。testqueue只是在我粘贴问题时使用的。它是EnformMessages在现实中阅读更多信息。出于各种原因,我似乎不应该使用MSMQ 4的远程队列功能。我想我会再试试分销商。好的,有些进展。在侦听器计算机上与侦听器一起部署分发服务器似乎表明侦听器已连接到分发服务器。现在,如何将消息发送给分发服务器?要将消息发送给分发服务器,必须让客户端向其发送一些工作。这可以是另一个NSB端点,也可以每隔一段时间向其自身发送消息。