How do I make messages durable

 FAQ > JMS > How do I make messages durable

Durability of messages is defined by the MessagerProducer. You can explicitly configure the durability via the setDeliveryMode() method. e.g.

MessageProducer producer = ...;
producer.setDeliveryMode(DeliveryMode.PERSISTENT);

Note that the default is for durable messages to be used if you don’t specify a delivery mode.

Apache ActiveMQ, ActiveMQ, ActiveMQ Artemis, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright © 2019, The Apache Software Foundation. Licensed under Apache License 2.0.