动态绑定多个队列到一个处理程序 [英] Dynamic binding multi queue to one handler

查看:94
本文介绍了动态绑定多个队列到一个处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将多个队列绑定到一个事件处理程序?关键是这些队列将被动态添加(绑定),第一个,下一个,依此类推。我想只有一个事件处理程序。

Is it possible to bind many queues to exactly one event handler ? The key thing is that these queues will be added (binded) dynamically, first one, next two and so on. I would like to have only one event handler.

也许基于代码的创建队列由 n 其他现有队列支持?

Maybe code-based created queue which is backed by n other existing queues ?

推荐答案

如果您使用 Spring AMPQ ,那么你应该熟悉 ListenerContainer 抽象。因此,您可以在您的术语中配置单个侦听器(处理程序),并让容器管理队列以及其他连接和生命周期选项。

If you use Spring AMPQ, then you should be familiar with the ListenerContainer abstraction. So, you configure your single listener (handler in your terms) and let the container to manage queues and other connection and lifecycle options.

您可以在中找到所有必需的选项。参考手册
另见监听器容器队列


参见方法 addQueues addQueueNames removeQueues removeQueueNames

更多信息:动态添加新的队列,绑定和交换作为bean

这篇关于动态绑定多个队列到一个处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆