Search code examples
c#msmq

Create outgoing queue in windows server 2008


This is rather a stupid question. But I couldn't find a good post regarding this.I want to create a queue in Outgoing queue in MSMQ. I have a task to get all the Outgoing queues in the machine and clear the messages if it matches to a criteria.

Can anybody give an idea how to create an Outgoing queue in Windows server 2008 machine.


Solution

  • You don't "create" an outgoing queue.

    When you send a message to a queue the MSMQ sub-system first writes the message to a local, temporary, outgoing queue before transmitting the message to the destination queue. The lifespan of the temporary outgoing queue is controlled by the MSMQ sub-system and not the developer.

    This is because MSMQ uses a store and forward model to transmit messages around.

    John Breakwell talks about this here.

    However, you can address the outgoing queues in the same way you would address the remote queue which you are sending to, but setting a flag called MQ_ADMIN_ACCESS.

    This technique is described here.