开发者

Publisher messages not reaching subscriber

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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜