WCF + MSMQ 4 : Who moves a message from retry queue back to the application queue?

4.1k views Asked by At

This is a simple question, but I was not able to find an answer.

Suppose my message is placed to the retry queue (who creates the retry queue? Is it a WCF or a MSMQ service?)

After 5 minutes (that's my retry delay) that message gets back to the application queue.

Question: who moves a message from retry queue to the application queue after the timeout?

Bonus question: how the delay is being tracked? Does a message get a "moved" timestamp and "retry" timestamp?

3

There are 3 answers

0
THX-1138 On BEST ANSWER

According to this article Handling Poison Messages MSMQ 4 provides few new features that allow an application to handle poison messages using subqueues. These features are:

  • abort counter
  • move counter
  • ability to move messages between main queue and subqueues, as well as between subqueues.

So it seems like actual move is handled by WCF, not MSMQ; and MSMQ simply now has facilities to support poison messages and retries handling.

5
Sixto Saez On

WCF with MSMQ 4.0 does provides for automatic retry and poison message handling although Hugh's answer is correct for older versions of MSMQ.

Edit from comments: On identifying the process that moves messages to the retry queues and back, I'd assume that its the MSMQ service itself since this is a new feature in MSMQ 4.0. WCF participates in the transaction that wraps all this activity and of course, handles messages place in the queue by MSMQ.

0
tom redfern On

WCF with the standard msmq bindings (netMsmqBinding and msmqIntegrationBinding) do not support retries. So in answer to your questions:

who creates the retry queue? - You do.

who moves a message from retry queue to the application queue after the timeout? - You do.

how the delay is being tracked? - You have to do it.

NServiceBus is open source and can use MSMQ for transport. This product provides retry functionality out of the box, but does not use WCF.

UPDATE

Above is valid for For MSMQ 3 and below.