tags:

views:

619

answers:

3

I have a system that sends a object to another service via WCF using MSMQ. The service picks the message up fine and does what it have to with it. But the problem i have now is that i need to send a response to the calling system.
Example:

  1. Create a Customer object
  2. Populate the information
  3. Send the message to the service using WCF over MSMQ
  4. Pick the message up from the queue using a windows service
  5. Call Customer.Insert() method on the windows service
  6. I now need to send the new customer id back to the calling application here.

Any ideas?

+1  A: 

MSMQ Operation needs to one way, the only way I can think of receiving back a message is for your calling application to also Host a service for responses since there's no duplex MSMQ binding.

Emmanuel
+3  A: 

As Emmanuel points out - MSMQ messages are by design one-way and have no response, really.

Your best solution would be to have a response queue where the "other service" can drop his response messages into. Your client would then have to monitor that queue, e.g. check it once in a while (every minute, every 30 minutes - whatever makes sense for you) for new messages, and handle those.

There's no duplex (two-way) MSMQ channels - but you can easily create a pair of separate queues for both directions.

Marc

marc_s
hmm yea thats what i was worried about. Hmmmmm thanks for the info
Neale
+1  A: 

you can use duplex communication with msmq but not natively, take a look to my article

Nicolas Dorier