| <div class="wiki-content maincontent"> |
| <p>Durability of messages is defined by the <a shape="rect" href="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MessageProducer.html">MessagerProducer</a>. You can explicitly configure the durability via the <a shape="rect" href="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MessageProducer.html#setDeliveryMode(int)">setDeliveryMode() method</a>. e.g.</p> |
| |
| <structured-macro ac:macro-id="5ec93947-a8e0-4c38-ad32-61b5733ffee4" ac:name="code" ac:schema-version="1"><plain-text-body> |
| MessageProducer producer = ...; |
| producer.setDeliveryMode(DeliveryMode.PERSISTENT); |
| </plain-text-body></structured-macro> |
| |
| <p>Note that the default is for durable messages to be used if you don't specify a delivery mode.</p></div> |
| |