Quick NetMsmqBinding question
Hi guys,
I have a quick question about the NetMsmqBinding. I knew the answer to this at one point but managed to forget
and now I'm having trouble finding the answer again.
For the NetMsmqBinding, the queue needs to be on the Service-side right? Can you use a queue on the Client-side or on a third machine?
Thanks,
Ting
[406 byte] By [
TZuge] at [2007-12-24]
Sure, you can have a Queue on both ends (Client and the server) for a Two-way communication. There is a sample in the SDK docs for this. Basically, you send messages to the Queue on the Server and the server responds back to the Queue on the client with a response.
I think I need to clarify my question a bit. When using a NetMsmqBinding, the queue that you put in the address, should that be a Server-side queue, a Client-side queue or can it even be on a third machine?
Let me also expand my question a bit. If the queue is on the Server side, is there also a Client -side queue that is used implicitly to handle the case where the Server machine is actually off and the service queue is unreachable? or does the Client just get an error about the queue being unavailable in that case?
Hello,
there are two queues involved in a typical MSMQ scenario.
- there's a destination queue, the one you specify in address. This is where the server picks messages from. This queue typically resides on the same machine as the server application, although it is possible to have it on some other machine. The server application has to have a live connection to the destination queue in order to pick messages.
- there's also an "outgoing" queue created automatically by MSMQ on the sender's machine. This queue handles the cases when the machine with the destination queue is unavailable. So there's no need for the client to have a connection to the destination queue. The MSMQ infrastructure, with the help of outgoing queues, will handle communication errors.
thanks, - leszek
>>where the Server machine is actually off and the service queue is unreachable? or does the Client just get an error about the queue being unavailable in that case?
MSMQ allows offline, reliable access. So if the Server machine is down it will be stored by the MSMQ infrastructure and later transmitted when the server is available. Journal Queues are what i guess is used to store these messages.
Journal queues is actually a different feature. When the journaling is turned on, the copies of the messages are being stored in the special, journal queues, so they become available for inspection later.
To reliably transfer messages to the destination queue, even if the destination machine is down, MSMQ uses the outgoing queues. These are created implicitly by MSMQ on the sender's machine. They are be visible through the MSMQ MMC snap-in; this is sometimes helpful to diagnose transfer problems.
thanks, -leszek