I have just started working up a sample application using Rhino
Service Bus. So far I am very impressed and have managed to get
everything working how I want with very little code and configuration.
Due to the type of system I am building I need to use Request/Reply
functionality for some things. The issue I have hit is that the reply
messages do not seem to be getting sent/recieved properly

The environment I am using is:

Rhino Service Bus v1.9.0.0 (although I have also tried 1.8)
Windows XP SP3 (MSMQ 3)
.Net 4.0

I have done some investigation and managed to get sending replies
working using a custom message IMessageModule to change the format of
the queue endpoint for the reply messages. However if someone could
explain what I am doing wrong or how I can figure out why this custom
code is needed it would be greatly appreciated.

When the message is recieved and I do a reply I can see that the queue
the reply will be sent to is of the format
'FORMATNAME:PRIVATE=81bf40d1-a337-4ee6-80e8-e198f6b5cdac\0000007b'. It
appears that when the message is sent it never makes it to this queue.
The way I managed to get this working was to change the queue the
reply message would be sent to so that it is of the format
'FormatName:DIRECT=OS:pc7262\private$\rhinotesting.testing1'. This
format change makes everything suddenly start working.

The message module I am having to use at the moment which fixes the
format is as follows:

public class ReplyQueueFixerMessageModule : IMessageModule
    {
        public void Init(ITransport transport, IServiceBus bus)
        {
            transport.MessageArrived += TransportOnMessageArrived;
        }

        public void Stop(ITransport transport, IServiceBus bus)
        {
            transport.MessageArrived -= TransportOnMessageArrived;
        }

        private static bool
TransportOnMessageArrived(CurrentMessageInformation
currentMessageInformation)
        {
            var sourceEndpoint = new Endpoint { Uri =
currentMessageInformation.Source };
            var sourceQueuePath =
MsmqUtil.GetQueuePath(sourceEndpoint);
            Uri sourceQueueUri;

            using (var sourceMessageQueue = new
MessageQueue(sourceQueuePath.QueuePath))
            {
                sourceMessageQueue.Path =
string.Format("FormatName:DIRECT=OS:{0}\\{1}",
sourceMessageQueue.MachineName, sourceMessageQueue.QueueName);
                sourceQueueUri =
MsmqUtil.GetQueueUri(sourceMessageQueue);
            }

            currentMessageInformation.Source = sourceQueueUri;
            return false;
        }
    }

Is anyone able to suggest anything?

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to rhino-tools-dev@googlegroups.com.
To unsubscribe from this group, send email to 
rhino-tools-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to