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.
- Publishing/Producer for point to point
messaging
- Message expiration
- Message persistence
- Subscribing
- Subscription durability
- Session acknowledgment mode (Applicable also for consumer point to point messaging)
Publishing
Setting 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.
Setting the delivery mode of the JMS message producer sets the persistence of the IBM® MQ message published to the specified topic.
Ensure that you use DeliveryMode.PERSISTENT for messages that must be retained when a queue manager is ended, or has an outage.
Subscribing
- createDurableConsumer()
- createSharedDurableConsumer()
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.