发布者消息未到达订阅者

时间:2011-02-10 01:47:37

标签: nservicebus

发布商配置                                                   

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

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

=&gt;发布者正在此计算机上运行,​​发布者队列在本地创建。

相同

=&gt;用户正在运行的机器。

配置文件是生产的,日志文件中没有例外。

消息丢失的任何线索。 谢谢帮忙......

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

当我开始工作时,我想把鼠标扔给别人。

对我来说,问题是我试图发送一个简单的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"));

现在工作正常