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

发布于 2024-08-24 05:59:27 字数 3258 浏览 3 评论 0原文

在我的消息发布者配置中

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

我也尝试以 http://www.candland.net/blog/2009/06/08/NServiceBusDistributorOverview.aspx。所以我的发布者配置看起来像

<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

In my message publisher configuration I have

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

which I was hoping would copy the messages published to EnformMessages to a queue on a remote machine. No messages ever seem to be sent to the remote machine although messages are certainly being received locally. The remote listener's config file looks like

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

  <UnicastBusConfig>
    <MessageEndpointMappings>

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

I also tried using the distributor in the fashion described at http://www.candland.net/blog/2009/06/08/NServiceBusDistributorOverview.aspx. So my publisher configuration looked like

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

Subscriber configuration like

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

and distributor like

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

No messages seem to arrive. In fact nothing is printed out by the distributor at all. I added a logging section to the config file in the hopes it would produce some output but got nothing.

Nservicebus 2.0.0.768

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月打碎记忆 2024-08-31 05:59:27

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

In a pub/sub scenario, it is the subscriber that will be forwarding messages to an audit queue, not the publisher. Also, you've told your subscriber that its publisher is "testqueue" but you specified your publisher's input queue as "EnformMessages". These two queues need to match up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文