When ever there is a message in the queue, I need my windows service to process the message in the queue.
I was thinking that it would probably be best to set up a windows service and when ever there is a message in the queue, that MSMQ should trigger, firing a call to the windows service.
Does anyone know how to do this?
If you wanted to, you can host a WCF ServiceHost in the Windows Service, which will automatically pick up the messages as they are received. No hook-ups to MSMQ are required. WCF will automatically pull the messages into the service when they appear.
Lets say you are already writing to the MSMQ private queue ‘test’. To write a running Windows Service, you do something like this, forgive the example for method accuracy in the service:
Then configuration for the Windows Service to read from MSMQ