We have this setting, where we call the web service to create the queue and get the queue name from the response.
Then we create a SimpleMessageListenerContainer and set the queue name there, and then run it.
However, the queue is deleted from time to time - as a result, error 404 cannot announce error XXXXXXXXX. In these cases, I need to call the web service again and add a new QueueName to SimpleMessageListenerContainer and then delete the old one.
The only way I understood to run any code for processing was to create a custom CachedConnectionFactory and override the shutdownCompleted method.
However, shutdownCompleted seems to fire when the SimpleMessageListenerContainer also switches, so it loops in a loop. The ShutdownSignalException thrown to shutdownCompleted does not seem to look different if the trigger is external from the server or with the client processing the new queue, so I cannot figure out how to skip processing during the "second" transition.
So, what is the usual way to detect and start user processing when the server kills the queue?
spring-amqp
Jörgen olsson
source share