Monday, April 16, 2012

WCF MSMQ Message Retries

Using this settings (maxRetryCycles="50", retryCycleDelay="00:01:30", receiveRetryCount="0") it will retry the message 50 times with a delay of 90 seconds between every retry.

< binding name="DasBinding"
exactlyOnce="true"
durable="true"
maxRetryCycles="50"
retryCycleDelay="00:01:30"
receiveRetryCount="0"
...

In this page (http://msdn.microsoft.com/en-us/library/ms731380.aspx) there's more information about the settings for the MSMQ binding in WCF. Here I list a few of them and their descriptions:

maxRetryCycles

An integer that indicates the number of retry cycles used by the poison-message detection feature. A message becomes a poison message when it fails all delivery attempts of all cycles. The default is 3. For more information, see MaxRetryCycles.

retryCycleDelay

A TimeSpan value that specifies the time delay between retry cycles when attempting to deliver a message that could not be delivered immediately. The value defines only the minimum wait time because actual wait time can be longer. The default value is 00:10:00. For more information, see RetryCycleDelay.

receiveRetryCount

An integer that specifies the maximum number of times the queue manager should attempt to send a message before transferring it to the retry queue. The maximum number of immediate delivery attempts. The default is 5.

1 comment:

fc said...

If we have the following settings the message will be process up to 24 times ((5+1)(3+1) = (6)(4) = 24). So the maximum the number of real attempts is 24.

maxRetryCycles="5"
receiveRetryCount="3"

If we have the following settings, the maximum number of attempts is 16 (15+1):

maxRetryCycles="15" receiveRetryCount="0"