Consider a stand-alone Java program main()(without a Java EE container) that uses JMS to send messages to a remote JMS queue.
main()
As I understand it, if the remote queue is unavailable for any reason (network problem, the server is down, the queue is full ...), an messageProducer.send(msg)exception is thrown.
messageProducer.send(msg)
Do I have to implement the retry logic myself or will the JMS-api solve it 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?
You must implement the retry logic yourself. Please note: if the connection fails, it can no longer be used, you will need to create a new connection to repeat.
, , , , , , . , , , ... , ...
, (, db) , . , jms, (, ). HA HA - , , - .
, , , ( db), , , , , .
, , , , JMS-, WebSphere MQ, , JMS , API . , JMS- API , JMS- JMS-, , . JMS, , .
, , .
WebLogic JMS, JMS SAF- . Weblogic SAF-
, . , , , . script, , , .. ... , .