0

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

1
  • Some wrong with the tags, read the servers as <publisherServer>" => the publisher is running on this machine and publisher queue is created locally. <publisherServer> is same as <dbserver> <Subscriberserver>=> the machine on which subscriber is running.
    – singhsa
    Feb 10, 2011 at 1:50

2 Answers 2

0

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.

2
  • Just to confirm, Internal outbound queue on publisher is the one defined under MsmqTransportConfig i.e. <MsmqTransportConfig InputQueue="HomeOfficePublisherQueue" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" UseJournalQueue="true" /> I enabled Journalling on it and I can see initial message in the Journal queue, when publisher starts up, but I don't see subsequent messages. I checked the MSDTC, it is configured correctly.
    – singhsa
    Feb 10, 2011 at 15:27
  • Using journaling on the inbound queue of the Publisher only shows you that the Subscriber's subscription messages have arrived. You need to check MSMQ's outbound internal queue("Outgoing Queues" in the mmc). What is the OS of both the Publisher and Subscriber?
    – Adam Fyles
    Feb 11, 2011 at 13:03
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.