简体   繁体   English

删除队列后,SimpleMessageListenerContainer上的Spring AMQP通知/事件

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

I have a scenario where I am consuming messages from queues using SimpleMessageListenerContainer . 我有一种情况,我使用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();

There is currently no event published when a consumer is cancelled due to a queue being deleted, aside from logging a WARN log. 除记录WARN日志外,由于删除队列而取消使用方时,当前没有发布任何事件。

Feel free to open an Improvement JIRA Issue and we'll see if we can get something into the upcoming 1.5 release. 随时打开“ 改进JIRA问题” ,我们将看看是否可以在即将发布的1.5版本中获得一些帮助。

In the meantime, you could possibly hook into your logging subsystem (eg 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. 同时,您可能会挂接到您的日志记录子系统(例如,配置自定义附加程序),或者甚至连接到框架为log4j和logback提供的AMQP附加程序之一,并让记录器队列中的使用方查找被取消的使用方日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM