Creating a reliable JMS client?

Consider a stand-alone Java program main()(without a Java EE container) that uses JMS to send messages to a remote JMS queue.

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.

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?
+3
source share
5 answers

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.

+1
source

, , , , , , . , , , ... , ...

, (, db) , . , jms, (, ). HA HA - , , - .

, , , ( db), , , , , .

+1

, , , , JMS-, WebSphere MQ, , JMS , API . , JMS- API , JMS- JMS-, , . JMS, , .

, , .

+1

WebLogic JMS, JMS SAF- . Weblogic SAF-

0

, . , , , . script, , , .. ... , .

0

All Articles