Spring AMQP Notification/Events on SimpleMessageListenerContainer, when queue gets deleted

1.1k views Asked by At

I have a scenario where I am consuming messages from queues using SimpleMessageListenerContainer. When any of these subscribed queues got deleted, I would like to get notification or events.

SimpleMessageListenerContainer simpleMessageListenerContainer
        = new SimpleMessageListenerContainer(cachingConnectionFactory);
simpleMessageListenerContainer.setQueueNames(
        "testQueue1","testQueue2","testQueue3");
simpleMessageListenerContainer.start();
1

There are 1 answers

0
Gary Russell On

There is currently no event published when a consumer is cancelled due to a queue being deleted, aside from logging a WARN log.

Feel free to open an Improvement JIRA Issue and we'll see if we can get something into the upcoming 1.5 release.

In the meantime, you could possibly hook into your logging subsystem (e.g. configure a custom appender), or even one of the AMQP appenders provided by the framework for log4j and logback and have a consumer on the logger queue look for the consumer cancelled log.