发布者消息未到达订阅者

发布于 2024-10-16 10:38:39 字数 2807 浏览 1 评论 0原文

发布者配置

  <!-- 1. In order to configure remote endpoints use the format: "queue@machine" 
       2. Input queue must be on the same machine as the process feeding off of it.
       3. Error queue can (and often should) be on a different machine.
       4. The community edition doesn't support more than one worker thread.
  -->

  <MsmqTransportConfig 
    InputQueue="HomeOfficePublisherQueue" 
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
    UseJournalQueue="true" 
  />

  <DBSubscriptionStorageConfig>
    <NHibernateProperties>
      <add Key="connection.provider"
           Value="NHibernate.Connection.DriverConnectionProvider"/>
      <add Key="connection.driver_class"
           Value="NHibernate.Driver.SqlClientDriver"/>
      <add Key="connection.connection_string"
           Value="Server=<dbserver>\corpdev;initial catalog=NServiceBus;Integrated Security=SSPI"/>
      <add Key="dialect"
           Value="NHibernate.Dialect.MsSql2005Dialect"/>
    </NHibernateProperties>
  </DBSubscriptionStorageConfig>

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


</configuration>

订阅者配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
  </configSections>

  <!-- 1. In order to configure remote endpoints use the format: "queue@machine" 
       2. Input queue must be on the same machine as the process feeding off of it.
       3. Error queue can (and often should) be on a different machine.
       4. The community edition doesn't support more than one worker thread.
  -->

  <MsmqTransportConfig
    InputQueue="VW_1140@<subscriberServer>"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5" 
    UseJournalQueue="true" 
  />

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="Message" Endpoint="HomeOfficePublisherQueue@<publisherServer>" />
    </MessageEndpointMappings>
  </UnicastBusConfig>  

</configuration>

当我从不同的机器运行发布和订阅时,来自发布者的消息不会到达订阅者。如果我在同一台机器上运行它们,它们就可以正常工作。

=>发布者正在该计算机上运行,​​并且发布者队列是在本地创建的。

相同

与=> 订阅者正在运行的机器。

该配置文件是生产环境,日志文件中没有异常。

消息被丢弃的任何线索。 感谢您的帮助...

Publisher config

  <!-- 1. In order to configure remote endpoints use the format: "queue@machine" 
       2. Input queue must be on the same machine as the process feeding off of it.
       3. Error queue can (and often should) be on a different machine.
       4. The community edition doesn't support more than one worker thread.
  -->

  <MsmqTransportConfig 
    InputQueue="HomeOfficePublisherQueue" 
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5"
    UseJournalQueue="true" 
  />

  <DBSubscriptionStorageConfig>
    <NHibernateProperties>
      <add Key="connection.provider"
           Value="NHibernate.Connection.DriverConnectionProvider"/>
      <add Key="connection.driver_class"
           Value="NHibernate.Driver.SqlClientDriver"/>
      <add Key="connection.connection_string"
           Value="Server=<dbserver>\corpdev;initial catalog=NServiceBus;Integrated Security=SSPI"/>
      <add Key="dialect"
           Value="NHibernate.Dialect.MsSql2005Dialect"/>
    </NHibernateProperties>
  </DBSubscriptionStorageConfig>

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


</configuration>

Subscriber config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
    <section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
  </configSections>

  <!-- 1. In order to configure remote endpoints use the format: "queue@machine" 
       2. Input queue must be on the same machine as the process feeding off of it.
       3. Error queue can (and often should) be on a different machine.
       4. The community edition doesn't support more than one worker thread.
  -->

  <MsmqTransportConfig
    InputQueue="VW_1140@<subscriberServer>"
    ErrorQueue="error"
    NumberOfWorkerThreads="1"
    MaxRetries="5" 
    UseJournalQueue="true" 
  />

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="Message" Endpoint="HomeOfficePublisherQueue@<publisherServer>" />
    </MessageEndpointMappings>
  </UnicastBusConfig>  

</configuration>

When i run pub and sub from diffrent machines, the messages from publisher don't reach subscriber. If I run them on the same machine they work fine.

=> the publisher is running on this machine and publisher queue is created locally.

is same as

=> the machine on which subscriber is running.

The profile is production and there is no exception in the log file.

Any clues why messages are getting dropped.
Thsnks for the help...

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

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

发布评论

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

评论(2

寄与心 2024-10-23 10:38:39

检查发布服务器上的内部出站队列。如果您在那里看到消息,则意味着它无法与订阅者通信。这通常意味着您可能没有运行 MSDTC,或者 MSDTC 的安全性配置不正确。确保您在 MSDTC 安全设置中设置了“允许入站”和“允许出站”。

Check the internal outbound queue on the Publisher. If you see messages there this means it can't communicate with the Subscriber. This usually means that you may not have MSDTC running or the security for MSDTC is not correctly configured. Make sure you have "Allow Inbound" and "Allow Outbound" set in the MSDTC security settings.

荒芜了季节 2024-10-23 10:38:39

当我的鼠标工作时,我想把鼠标扔向某人。

对我来说,问题是我试图发送一个简单的 poco 类作为我的消息。
app.config

  <UnicastBusConfig ForwardReceivedMessagesTo="audit">
    <MessageEndpointMappings>
      <add Assembly="Messages" Endpoint="pub" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

然后我想也许我需要告诉对象应该是什么,所以我将消息配置为消息

Configure.With()
.DefiningMessagesAs(t => t.Namespace != null && t.Namespace.Contains("Messages"));

仍然不起作用,所以为了咧嘴一笑,我将其更改为

Configure.With()
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains("Messages"));

现在它工作正常

I wanted to chuck my mouse at someone when I got mine working.

For me, the problem was that I was trying to send a plain poco class as my message.
app.config

  <UnicastBusConfig ForwardReceivedMessagesTo="audit">
    <MessageEndpointMappings>
      <add Assembly="Messages" Endpoint="pub" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

Then I thought maybe I need to tell what the object is supposed to be, so I configured the message as a message

Configure.With()
.DefiningMessagesAs(t => t.Namespace != null && t.Namespace.Contains("Messages"));

Still didn't work, so then for grins i changed it to this

Configure.With()
.DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains("Messages"));

Now it works fine

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