如何配置 activemq 队列以使其不接受消息?

发布于 2024-09-16 05:16:36 字数 87 浏览 2 评论 0原文

我是一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你与清晨阳光 2024-09-23 05:16:36

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

断念 2024-09-23 05:16:36

查看生产者流程控制 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

椒妓 2024-09-23 05:16:36

根据您的要求,您可能需要考虑配置待处理消息限制策略或消息驱逐策略:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文