JamesEggers
JamesEggers

Reputation: 12935

NServiceBus Failed raising Transport Message Received event

Scenario:

The error that the Destination Gateway throws is:

WARN NServiceBus.Unitcast.Transport.Msmq.MsmqTransport [(null)] <(null)> - Failed raising 'transport message received' event for message with ID=GUID System.NullReferenceException: Object reference not set to an instance of an object.

This error initially was setup on 2 different servers though it occurs when I run the scenario locally, under admin rights, on my local computer (just listening on different ports). I'm setting the SetHttpToHeader() of the message to the proper destination address.

The gateway configs are as follows:

Gateway1:

<appSettings>
    <add key="NumberOfWorkerThreads" value="10"/>

    <add key="InputQueue" value="Gateway1Pickup"/>
    <add key="ErrorQueue" value="Gateway1Error"/>
    <add key="ForwardReceivedMessageTo" value="audit"/>

    <add key="OutputQueue" value="Gateway1Output"/>
    <add key="ListenUrl" value="http://address:6768/Gateway/"/>

    <add key="RequireMD5FromClient" value="true"/>
  </appSettings>

Gateway2:

<appSettings>
    <add key="NumberOfWorkerThreads" value="10"/>

    <add key="InputQueue" value="Gateway2Pickup"/>
    <add key="ErrorQueue" value="Gateway2Error"/>
    <add key="ForwardReceivedMessageTo" value="audit"/>

    <add key="OutputQueue" value="Gateway2Output"/>
    <add key="ListenUrl" value="http://address:6768/Gateway/"/>

    <add key="RequireMD5FromClient" value="true"/>
  </appSettings>

Does anyone know where I'm going wrong on this?

Upvotes: 1

Views: 2894

Answers (2)

Michael Joyce
Michael Joyce

Reputation: 601

I found this above problem showed up when I didn't have some dependent assemblies in the service directory. I found the error attached to the message in the MSMQ queue. I used Queue Explorer, but I presume other tools would show the same.

Upvotes: 0

Adam Fyles
Adam Fyles

Reputation: 6050

At first I got a solid repro and then I realized that NSB does not handle creating the Audit queues for you. If you remove them from the config or create the Audit queues, you should be all set.

Upvotes: 3

Related Questions