Setting the JMS Message Acknowledgement Mode

JMS channels support connection to TIBCO Enterprise Message Service destinations. The default acknowledgement mode is EXPLICIT.

You can set the acknowledgement mode either of these two ways:

  • In the AckMode field of a destination resource.
  • Using a configuration property.

The destination setting overrides the property setting. To set the acknowledgement mode using a configuration property, use one of the following, depending on whether you are using topics or queues:

be.channel.tibjms.topic.ack.mode acknowledgement_mode_number
be.channel.tibjms.queue.ack.mode acknowledgement_mode_number

Where acknowledgement_mode_number is one of the numbers that represent an acknowledgement mode, as shown in Table 12.

Note that in TIBCO Enterprise Message Service, mode names are slightly different. They are prefixed with TIBEMS-. See TIBCO Enterprise Message Service User’s Guide for more details.

JMS Message Acknowledgement Modes
No. Mode Description
1
AUTO_ACKNOWLEDGE
    Specifies that the session is to automatically acknowledge consumer receipt of messages when message processing has finished.
2
CLIENT_ACKNOWLEDGE
    Specifies that the consumer is to acknowledge all messages that have been delivered so far by the session. When using this mode, it is possible for a consumer to fall behind in its message processing and build up a large number of unacknowledged messages.

See Using CLIENT_ACKNOWLEDGE Mode with Websphere MQ and Cache-Aside for required configuration for Websphere MQ when cache-aside database write strategy is used.

3
DUPS_OK_ACKNOWLEDGE
    Specifies that the session is to lazily acknowledge the delivery of messages to the consumer. “Lazy” means that the consumer can delay acknowledgement of messages to the server until a convenient time; meanwhile the server might redeliver messages. This mode reduces session overhead. However, should JMS fail, the consumer may receive duplicate messages.
23 EXPLICIT_CLIENT_ACKNOWLEDGE (TIBCO Proprietary)
    TIBCO Enterprise Message Service extension to JMS acknowledge modes.

This is the default.

EXPLICIT_CLIENT_ACKNOWLEDGE is like CLIENT_ACKNOWLEDGE except it acknowledges only the individual message, rather than all messages received so far on the session.

One example of when EXPLICIT_CLIENT_ACKNOWLEDGE would be used is when receiving messages and putting the information in a database. If the database insert operation is slow, you may want to use multiple application threads all doing simultaneous inserts. As each thread finishes its insert, it can use EXPLICIT_CLIENT_ACKNOWLEDGE to acknowledge only the message that it is currently working on.

24 EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE (TIBCO Proprietary)
    TIBCO Enterprise Message Service extension to JMS acknowledge modes.

EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE mode is like TIBEMS-DUPS-OK-ACKNOWLEDGE except it "lazily" acknowledges only the individual message, rather than all messages received so far on the session.

22 NO_ACKNOWLEDGE (TIBCO Proprietary)
    TIBCO Enterprise Message Service extension to JMS acknowledge modes.

Suppresses the acknowledgement of received messages. After the server sends a message to the client, all information regarding that message for that consumer is eliminated from the server. Therefore, there is no need for the client application to send an acknowledgement to the server about the received message. Not sending acknowledgements decreases the message traffic and saves time for the receiver, therefore allowing better utilization of system resources.

Note
 Sessions created in NO_ACKNOWLEDGE receipt mode cannot be used to create durable subscribers.
Note
 Also, queue receivers on a queue that is routed from another server are not permitted to specify NO_ACKNOWLEDGE mode.