Accessing the Error queue

25 views
Skip to first unread message

Jason Meckley

unread,
Dec 14, 2011, 4:34:36 PM12/14/11
to rhino-t...@googlegroups.com
messages are moved to the error queue after X number of failed attempts. What's the cleanest way to determine if that message exists in the error queue?
My first implementation is to duplicate the current logic of error message handler.
count the number of attempts per TransportMessageId. if the count is greater than or equal to the number of retries, do something else continue on.
when completed if exception is null or retry limit has been reached, remove counter.

I am hoping for something simpler like
On_MessageProcessingFailure
{
   var key = new MessageId
    {
        MessageIdentifier = ?,
        SourceInstanceId = ?
    };

   if(exception == null) return;
   if(queue.PeekById(messageId) == null) return;

   using(var tx  = new TransactionScope(RequiresNew))
   {
        bus.DelaySend(later, new MessageForMe());
        tx.Complete();
   }
}

However, I don't know how to construct the messageId. what are the message and source identifiers? I also don't like how this ties me into RQ, but I don't see a higher level abstraction between RQ and MSMQ. I'm assuming the transport is it, which is what I currently have and it's complex. What is required to build the MessageId object, or is this approach even possible?
Reply all
Reply to author
Forward
0 new messages