Apache Qpid JMS message reliability

There are four features of the Apache Qpid™ JMS library that allow you to control the reliability of message delivery to, and from, AMQP applications.

These are for:

  • Publishing

    • Message expiration
    • Message persistence

  • Subscribing

    • Subscription durability
    • Session acknowledgment mode


Publishing

Message expiration

Set the time-to-live value of the JMS producer affects the expiry time given to messages published by that message producer.

Ensure that the time-to-live value for a JMS producer is sufficiently large that messages are consumed before they expire.

Alternatively, leaving the time-to-live value unset prevents the message from expiring from the subscription queue.

Message persistence

Set the delivery mode of the JMS message producer sets the persistence of the IBM MQ message published to the specified topic.

Ensure that we use DeliveryMode.PERSISTENT for messages that must be retained when a queue manager is ended, or has an outage.


Subscribing

Subscription durabilityAMQP channels support the creation of durable subscriptions by using the durable versions of the JMS create consumer methods:

  • createDurableConsumer()
  • createSharedDurableConsumer()

Session acknowledgment mode

To guarantee that a consumed message has been fully processed before it is removed from the IBM MQ subscription queue, create a JMS session using the Session.CLIENT_ACKNOWLEDGE mode and use the message.acknowledge() method to acknowledge this message and any others previously received on this session.

Parent topic: Message delivery reliability


Related concepts