Using Failover transport (Advanced)
In this recipe we look at how we can create more robust JMS applications by making use of ActiveMQ's Failover transport to automatically reconnect a client to a broker in case of a connection failure. We will also discuss some general error-handling tips when using JMS in our applications.
Getting ready
For this recipe we will use two examples; the first is failover-producer and the second is failover-consumer that demonstrate how a lost connection doesn't have to affect our client applications.
How to do it...
To run the sample for this recipe, you will need to perform the following steps:
- Open a terminal and start a broker.
- Open a second terminal, change the path to the directory where failover-consumer is located, ...
Get Instant Apache ActiveMQ Messaging Application Development How-to now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.