There are 2 servers (amq1, amq2) with ActiveMQ deployed. The service that creates the queues is on the third server.
in the connection settings, I specified spring.activemq.broker-url: failover:(ssl://amq1:61616,ssl://amq1:61616)
Both servers work correctly and do not lose connection.
The problem is that the service first connects to amq1 in priority, but sometimes it changes the connection to amq2, then returns to the first one. There is no message in the logs that the connection to amq1 is missing.
INFO 24003 --- [ActiveMQ Task-1] oaatfailover.FailoverTransport : Successfully connected to ssl://amq2:61616 INFO 24003 --- [ActiveMQ Task-1] oaatfailover.FailoverTransport : Successfully connected to ssl://amq2:61616 INFO 24003 --- [ActiveMQ Task-1] oaatfailover.FailoverTransport : Successfully connected to ssl://amq1:61616 ERROR 24003 --- [http-nio-127.0.0.1-8080-exec-4] roRestExceptionHandler : dm.exception.ActiveMQException: Failed get JMS response: INFO 24003 --- [ActiveMQ Task-1] oaatfailover.FailoverTransport : Successfully connected to ssl://amq2:61616 INFO 24003 --- [ActiveMQ Task-1] oaatfailover.FailoverTransport : Successfully connected to ssl://amq1:61616 How can I make the connection to amq2 only if amq1 stops responding?
ps if you specify only one amq server, then when the connection is lost, spring 10 times by default tries to reconnect. I would like to change the connection to amq2 after 10 times