FlatQueueStrategy.SendToErrorQueue on Win7

13 views
Skip to first unread message

Morten

unread,
Jun 21, 2011, 5:26:35 AM6/21/11
to Rhino Tools Dev, morte...@systematic.com
We got an issue with Rhino Service bus when running on Win7.

The issue is that, we have implemented a MappingSagaErrorHandler which
uses the SendToErrorQueue method to send the original message to the
errorqueue. SendToErrorQueue is found on IQueueStrategy, in this case
the FlatQueueStrategy. On Win XP this worked like a charm however
after upgrading to Win7, the message gets send to the original queue.

Can anybody explain this behavior?

Kind regards
Morten Lund

René M. Andersen

unread,
Jun 21, 2011, 2:26:00 PM6/21/11
to rhino-t...@googlegroups.com, morte...@systematic.com
Hi Morten,

How are you and the other guys doing?

On Win7 you don't use the FlatQueueStrategy, but the SubQueueStrategy, since Win7 uses MSMQ 4.0 which supports sub queues.
Not sure if your problem is caused by an error in the SubQueueStrategy.SendToErrorQueue method, but it seems to behave differently than the one in the FlatQueueStrategy used on WinXP. Try Comparing the following code:

SubQueueStrategy.cs:
public void SendToErrorQueue(OpenedQueue queue, Message message)
{
    queue.Send(message);
}

FlatQueueStrategy.cs
public void SendToErrorQueue(OpenedQueue queue, Message message)
{
    using(var errQueue = new MessageQueue(GetErrorsQueuePath()))
    {
// here we assume that the queue transactionalibilty is the same for the error sibling queue
// and the main queue!
    errQueue.Send(message, queue.GetSingleTransactionType());
    }
}

It seems that the implementation doesn't take the error queue into account?

As a work around, try using the below method instead:
queueStrategy.TryMoveMessage(queue, message, SubQueue.Errors,out msgId)

Anyone has an idea, whether this is a bug?

Say hi to everyone from me :)

Regards
René

Morten

unread,
Jun 21, 2011, 5:11:45 PM6/21/11
to Rhino Tools Dev
Thanks Rene!

Actually I've looked at the source already, but wasn't sure if it was
a bug that the SubQueueStrategy just calls Send directly on the
OpenedQueue! Also didn't realize that we were using the
SubQueueStrategy automatically when switching to Win7... I will look
into the TryMoveMessage workaround tomorrow!!

Hope you are doing well at Kampstrup - And not submitted to to much
"HG-poisoning" :) !

- Morten

On 21 Jun., 20:26, René M. Andersen <renemygindander...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages