I’m working on a Spring Boot microservice-based backend application with ActiveMQ to communicate between them. I had a problem in our production environment where, by maintenance, the ActiveMQ Kubernetes instance was restarted. All microservices reconnected once the ActiveMQ was up and ready again, except for one: it kept trying to reconnect without success.
After 160+ retries in my local environment, I’ve been able to reproduce the issue just once and without more error traces than the microservice logs:
“Could not refresh JMS Connection for destination ” – retrying using FixedBackOff{interval=5000, currentAttempts=128, maxAttempts=unlimited}. Cause: The JMS connection has failed: java.io.EOFException”.
As you can see this is a very rare error but it happens. In terms of configurations, everything looks alright, it tries to reconnect every 5 seconds forever (it usually works instantly). With AmazonMQ I did not find any extra config parameter available related to my issue.
My only guess is that maybe two microservices tried to reconnect at the exact same time and one override the connection of the other. Can this even happen? Any other possibilities?