如何配置 activemq 队列以使其不接受消息?
我是一个 activeMQ 新手。是否可以在 activeMQ xml 配置中添加一些内容,以强制队列在(例如)特定队列中已存在 100 条消息时停止接受消息?
I am an activeMQ newbie. Is it possible to add something to the activeMQ xml configuration to force a queue to stop accepting messages when (for example) 100 messages are already in a specific queue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ActiveMQ 使用 JMX 公开队列大小,因此我想您可以使用该信息来限制队列大小。
请参阅: 队列大小线程
ActiveMQ expose the queue size with JMX, so i guess you can use that information to limit the queue size.
see: Queue size thread
查看生产者流程控制 http://activemq.apache.org/ Producer-flow -control.html
它限制队列占用的内存量
Take a look at Producer Flow Control http://activemq.apache.org/producer-flow-control.html
It limits your queue on the amount of memory the queue takes
根据您的要求,您可能需要考虑配置待处理消息限制策略或消息驱逐策略:
http://activemq.apache.org/slow-consumer-handling.html
这两个选项主要用于在消费者速度较慢的情况下使用消费者的预取缓冲区。但我向您推荐它们是因为我不了解您问题的完整背景或不知道您的要求。
布鲁斯
Depending on your requirements, you may want to consider configuring a pending message limit strategy or a message eviction policy:
http://activemq.apache.org/slow-consumer-handling.html
These two options are mainly for use in a slow consumer situation to work with the consumer's prefetch buffer. But I'm suggesting them to you because I don't understand the full context of your question or know your requirements.
Bruce