Apache ActiveMQ ™ -- 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.