New Queue Service “Discard All Bad Messages” Mode

 

This feature will cause the queue service to act in the following manner when this special mode is activated:

    If the message causes an error, then the message is discarded.

    If the handling would cause this message to be placed onto the Retry queue, then the message is placed on the retry queue so long as the number of retry attempts has not been exhausted.  If they have, then the message is discarded instead.

    When a message is discarded, the following actions occur for that message only:

The reason (e.g. exception information) is written to the queue service log.

The message itself is written to the bad messages folder specified by the badMessageSavePath appSetting.

No email it sent (even if email is configured to be sent for messages that cause errors).

No message is sent to the error queue.

The message is removed from the request or retry queue that it came from.

The queue service will NEVER re-process this message again.

    If the config file has both “Process/Discard First Message” and “Discard All Bad Messages” modes activated, then only the “Process/Discard First Message” mode is activated.  This behavior allows you can activate “Process/Discard First Message” mode without having to remove or adjust any “Discard All Bad Messages” settings first.

 

There are three ways to specify this “Discard All Bad Messages” setting:

 

1. To target ALL queue servers enter it as an application setting:

 

<add key ="discardAllBadMessages" value="True" />

 

2. To target a specific queue server:  Add a DiscardAllBadMessages=”True” attribute to that queue server’s config section:

 

<QueueServer QueueServerName="…" DiscardAllBadMessages="True" RequestQueue="…" RetryQueue="…" ErrorQueue="…" MirrorQueue="…" />

 

3. To target a specific handler, add a DiscardAllBadMessages=”True” attribute to that handler’s config section (notice that this is the “I”nterface handler):

 

<IUnigrpRegMessageHandler domainName="" assemblyName="MSS.Queueing" typeName="MSS.Queueing.XmlUnigrpRegMessageHandler" DiscardAllBadMessages="True" />