This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Maximum Delivery Attempts

When you use queues in WSO2 Message Broker, messages will be removed from the message store once the message consumers acknowledge that the messages are received. There are several acknowledgement models defined in JMS specification 1.1. 

To configure the time within which consumers can acknowledge messages, you can set the AndesAckWaitTimeOut entry in the JMS client as follows:

System.setProperty("AndesAckWaitTimeOut", "30000");

If the acknowledgement fails within the above time, the client informs the MB server that the message is rejected. The message is then scheduled to be redelivered later by the server. If you want to limit the number of times the message broker attempts to redeliver the message, you can set the maximumRedeliveryAttempts element in the broker.xml file as follows:

<!--Broker will drop the message after the configured number of delivery attempts for each message.-->
	    <maximumRedeliveryAttempts>10</maximumRedeliveryAttempts>

Note that the above configuration specifies the total number of attempts to redeliver the message after the original delivery attempt. For example, when the first attempt to send the message fails, there will be another 10 attempts to redeliver the message. After the maximum number of attempts to redeliver the message are breached, the message is sent to the Dead Letter Channel. This is useful when the client application does not acknowledge the message because an operation on the message failed.

If the message is successfully delivered on a redelivery attempt, the JMSRedelivered field is set to 'true' in the message header, allowing the client to determine whether the message was delivered by the original attempt or on a later attempt.