I am using MSMQ transport in our rebus implementation. Below is the code for starting rebus service:
BuiltinHandlerActivator handlerActivator;
this.handlerActivator.Handle<TransportMessage>
(this.HandleTransportMessageAsync);
var bus = Configure.With(this.handlerActivator)
.Transport(t => t.UseMsmq(this.SenderName))
.Routing(r => r.TypeBased().AddEndpointMappingsFromAppConfig())
.Start();
I want to handle exception/errors in case some one accidentally deletes message queues using snoop/compmgmt.msc.
When I remove the MSMQ message queue manually in message queuing we receive a error with text
rebus worker queue was deleted - will not receive any more messages
.
So, want to know Is it possible in Rebus to handle this exception and supply a call back or any other way?
I noticed there is a class called MsmqTransport in Rebus.MSMQ namespace which expose method AddQueueCallback to supply similar callback. Since I am newbie to Rebus/MSMQ I am not able to figure out how to use this. Any support would be helpful.