Adithya Puram
Adithya Puram

Reputation: 303

JMS Reliability, handling Server down

I am trying to create a reliable JMS environment using ActiveMQ. I am planning to go for a JDBC master slave clustering approach in which I can persist the messages received by master server to database and slave server can pick those messages and run them in case the master server dies. But I don't have a solution to the situation in which both the master and slave go down(due to any reason). If that happens, will the messages sent by producer get lost for ever? I can do something like persisting messages to database and executing them after one of the JMS servers recover, but is there a better/built-in solution to handle such scenarios?

Upvotes: 2

Views: 1099

Answers (1)

raffian
raffian

Reputation: 32066

I can do something like persisting messages to database and executing them after one of the JMS servers recover, but is there a better/built-in solution to handle such scenarios?

You've got the right idea. If the producer can't connect, under normal circumstances, it will throw an exception. You want a store-and-forward (SAF) producer; if the client can't reach the destination, messages are stored locally on the client file system, and sent when the client reconnects with the broker.

Based on nos' comments below, it appears ActiveMq supports store-and-forward using local storage for clients I've asked nos to submit his comments as the answer.

Upvotes: 2

Related Questions