1
votes

I'm hoping this will be an easy one for someone to point out that I've done something stupid!

I've recently tried to set up MassTransit on our systems here, but I'm having some issues with messages not being handled by my subscriber. The messages are handled fine up until the subscribing service gets restarted / redeployed, and after that they just don't work.

The Subscribing service is a Windows Service. I am using MSMQ along with the RuntimeServices bundled with MassTransit (v2.8).

I'm hoping I've missed something with regard to setting up a permanent subscription, but I've been hunting for more information without much luck.

Anyone have any idea if I've set something up wrong?

Here is the Initialization code:

Publishing Service

    public static void Activate()
    {
        Bus.Initialize(bus =>
        {
            bus.UseMsmq(msmq => msmq.UseSubscriptionService("msmq://localhost/subscriptions"));
            bus.UseControlBus();
            bus.ReceiveFrom("msmq://localhost/our_webservice");
        });

    }

    public static void Shutdown()
    {
        Bus.Shutdown();
    }

Subscribing Service

    private void ConfigureMessageBus()
    {
            Bus.Initialize(bus =>
            {
                bus.UseMsmq(msmq => msmq.UseSubscriptionService("msmq://localhost/subscriptions"));
                bus.ReceiveFrom("msmq://localhost/commissionupdate_service");
                bus.Subscribe(s => s.Consumer<CommissionUpdatedHandler>().Permanent());
            });
     }

    protected override void OnStop()
    {
        Bus.Shutdown();
    }

Please let me know if I can provide any more information that will help find the problem.

Thanks in advance! Jim.

1
Have you looked at the queues? Sometimes it's obvious from the look of the queues. Otherwise, add a logger (Masstransit.NLog for example), enable logging (by configuring masstransit namespace with DEBUG level). Try UseMulticastSubscriptionClient() instead. - Eugene Tolmachev
have you gotten a resolution to this? having the same issue - Alex Gordon

1 Answers

0
votes

I don't know If this will help however We had a similar problem. In Our situation We had Azure Service Bus and unnecessary code in Publishing Service:

_busHandle = await _bus.StartAsync(cancellationToken).ConfigureAwait(false);

When I've removed it the problem was solved.