Consider a stand-alone Java main()
program (no Java EE container) which is using JMS for sending messages to a remote JMS queue.
As I understand, if the remote queue is not available for some reason (network problem, server down, queue full...), messageProducer.send(msg)
throws an exception.
Do I have to implement the retry-logic myself or will the JMS-api solve this for me somehow?
TextMessage message = session.createTextMessage();
message.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
MessageProducer mp = session.createProducer(topic);
mp.send(message); // Throws JMSException. How to retry, local storage etc?