MSMQ WCF retry message blocks

503 Views Asked by At

we've using MSMQ for transactional processing of messages sent to an in-house service bus running on Windows Server 2012 and have run into issues when message processing has failed.

Setup of the service

Service

<endpoint address="net.msmq://localhost/private/quoteandbuy_transactions" binding="netMsmqBinding" bindingConfiguration="MsmqQuoteAndBuy" name="Msmq" contract="Soa.Net.EndPoints.IMessagingXmlProcessor" />

Binding

<binding name="MsmqQuoteAndBuy" durable="true" exactlyOnce="true" maxRetryCycles="100" receiveErrorHandling="Move" receiveRetryCount="0" retryCycleDelay="01:00:00" useMsmqTracing="true"  maxReceivedMessageSize="2147483647">
  <readerQuotas maxStringContentLength="2147483647" />
  <security mode="None">
    <transport msmqAuthenticationMode="None" msmqProtectionLevel="None" />
    <message clientCredentialType="None" />
  </security>
</binding>

As you can see we have a cycle running every 1 hour with a limit of 100 retries per message. This by default will not ever be achieved as the TTL for the message is 24 hours (default).

We have transaction in the MSMQ that can fail due to the process being undertaken by a 3rd party. The message gets dropped onto the retry sub-queue. A few more come in and the same happens. Say now for instance we have 20 fails.

As it currently stands only the first message (sometimes the second as well?) will be retried and this will most likely have the same failed process so we again do not commit the transaction.

I would expect that all messages that have reached the retry cycle time span to get moved to the main queue to be tried again, but this does not happen. The top message will continue to block until its TTL is reached or finally succeeds.

Is the a way of setting up the behavior of the queue to not block and process all messages where it retry time span has been reached.

We are in a situation where if say 20 messages are received within a 10 minute period that if they all fail only the first message is retried every hour and the other 19 sit there until the TTL is reached on the first message they then get tried and because they have reached there TTL they also get removed from the retry queue.

I understand that the messaging works on a FIFO basis and that before MSMQ on vista that a message failing would block other messages hence the retry message queue. But hasn't this just moved the problem to the retry sub-queue?

0

There are 0 best solutions below