如何为activemq设置队列最大长度 [英] How to set queue max length for activemq

查看:820
本文介绍了如何为activemq设置队列最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在activemq上配置队列的最大长度,以便当队列的长度达到限制时,入队操作将失败或引发异常。有人知道这个问题吗?任何帮助将不胜感激。

I'm wondering if I can configure a queue's max length on activemq, so that when the queue's length touch the limit, the enqueue operation will failed or throw exceptions. is anybody know about this question? any help will be very appreciated.

非常感谢。

推荐答案

看看Producer Flow Control 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 so its not a numbers of messages approach but a memory sizing approach. You can have an exception thrown back to the client when the broker reaches its max resources limit.

这篇关于如何为activemq设置队列最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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