Using Java how do i configure ActiveMQ to load balance and reconnect when disconnection occur?
As i understand those configuration should be made on the ActiveMQConnectionFactory object.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To do that, you set the brokerUrl of the ActiveMQConnectionFactory to a failover transport URI;
If you only have one broker, the below should be enough, ok for testing of reconnects but for production you’ll most likely want more than one;
Unlimited reconnection attempts is the default, but you can tweak quite a few options if you look at the documentation linked above.