Currently my task is to stop my spring boot app if the messaging queue fails to connect 5 times. I have found great use of
DefaultJmsListenerContainerFactory.setBackOff()
This will successfully stop the container after 5 failed attemps however when I use
@JmsListener(containerFactory="myFactory")
I am not explicitly creating the container and spring is doing it for me. So how can I check if the container shut down in order to close the spring boot app?
"myFactory"
a custom container factory? If so are you creating it with a bean method? Can you call thesetBackOff
in your container factory bean method? – Hopey One