Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.
This documentation is for WSO2 Message Broker version 3.2.0. For the latest documentation, see the documentation for WSO2 Enterprise Integrator.
Skip to end of metadata
Go to start of metadata

A subscriber client receiving messages from a queue or topic in the broker should be configured to send an acknowledgement back to the broker when the messages are received. There are several acknowledgement methods that can be used by the subscriber.

Configuring the time taken to acknowledge messages 

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 acknowledgment 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. 

Configuring standard JMS message acknowledgment patterns

The following are acknowledgment patterns introduced by JMS:

  • Auto Acknowledge 
  • Duplicates Allowed
  • Client Acknowledge
  • Transacted Acknowledgement

Configuring per-message acknowledgment

Per-message acknowledgment can be used to ensure that the subscriber client acknowledges each message that is received. The subscriber can enable this feature by using one of the following options when creating the session.

  • Use the org.wso2.andes.jms.Session.PER_MESSAGE_ACKNOWLEDGE enum available in the andes-client JAR  as shown below.

    import org.wso2.andes.jms.Session;
    QueueSession queueSession = queueConnection.createQueueSession(false, Session.PER_MESSAGE_ACKNOWLEDGE);
  • Alternatively, you can use the value 259 as shown below.

    QueueSession queueSession = queueConnection.createQueueSession(false, 259);

Following is a sequence diagram on how an example scenario will work:

 Screen Shot 2016-07-21 at 12.00.00 PM.png

  • No labels