Jason Meckley
unread,Dec 7, 2011, 8:31:26 AM12/7/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rhino-t...@googlegroups.com
by default the bus will attempt to consume a message 3 times (this can be overrriden). after that the message is moved to the error queue. With MSMQ you can easily move the message back into the the main queue for processing once the bug is resolved and the message can be processed. With RQ I haven't found a good way to get the message out of the error queue.
if you want to add additional "generic" behavior to the exception handling workflow then implement IMessageModule and hook into the appropriate messaging events (arrived, completed, error, etc). Note: if you will be sending another message from the message module and an exception is thrown, you will need to explicitly wrap the action in a new transaction scope. otherwise the message will not be sent because the parent transaction is rolled back.
using(var tx = new TransactionScope(Scope.RequiresNew))
{
var message = new HandlingExceptionMessage{Exception = exception};
bus.Send(message);
tx.Complete();
}