1
votes

I have trouble sending a message via NServiceBus. I have an ASP.Net MVC web app, developing on Win7 x64, I have configured my web.config as

       <MsmqTransportConfig    InputQueue="worker"    ErrorQueue="error"    NumberOfWorkerThreads="1"    MaxRetries="5"   />

  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="PricingInformation.Messages" Endpoint="worker2" />
    </MessageEndpointMappings>   </UnicastBusConfig>

In application_start I wire up the following:

var bus = NServiceBus.Configure.WithWeb()
            .StructureMapBuilder()
            .XmlSerializer()
            .MsmqTransport()
                .IsTransactional(false)
                .PurgeOnStartup(false)
            .UnicastBus()
                .ImpersonateSender(false)
            .CreateBus()
            .Start();

When the action I'm interested happens in the app I fire

    public override void HandleEvent(SupplierPricingUpdatedEvent updatedEvent)
    {
        bus.Send(new ModelSupplierDetailsUpdatedMessage() {Id = updatedEvent.Id})
        return;
     }

ModelSupplierDetailsUpdatedMessage is simple class in PricingInformation.Messages using interface marker IMessage and decorated with Serializable attribute.

The MSMQ queues are setup, not transactional, and everyone including NETWORK SERVICE and IIS_IUSRS have full control (in deseperate troubleshooting measures)

log4net shows the following:

DEBUG NServiceBus.Utils.MsmqUtilities  14 - Checking if queue exists: worker.

DEBUG NServiceBus.Utils.MsmqUtilities 14 - Checking if queue exists: error. DEBUG NServiceBus.Unicast.UnicastBus Worker.15 - Calling 'HandleBeginMessage' on NServiceBus.SagaPersisters.NHibernate.NHibernateMessageModule INFO NServiceBus.Unicast.UnicastBus Worker.15 - worker initialized. DEBUG NServiceBus.Unicast.UnicastBus Worker.15 - Calling 'HandleEndMessage' on NServiceBus.SagaPersisters.NHibernate.NHibernateMessageModule DEBUG NServiceBus.Unicast.UnicastBus 9 - Sending message PricingInformation.Messages.ModelSupplierDetailsUpdatedMessage, PricingInformation.Messages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null with ID 2c642672-1bf1-48d4-a90f-734e2fdd726d\8267 to destination worker2.

Yet no matter what I try, and what I tweak (been three hours at it already) the message never appears in the queue. I cant find an exception and i have debug level logging on everything.. Its probably something simple help

1

1 Answers

6
votes

The problem is that if you manually set up your queues as non-transactional, then it won't work. Setting the NServiceBus "IsTransactional" property to false doesn't mean you can work with non-transactional queues.

Please try deleting the queues and recreating them as transactional or, if you're using the beta of v2.0, just letting NServiceBus create the queues for you.