在ActiveMQ队列上侦听的所有JMS使用者的油门消耗率 [英] Throttle consumption rate of all JMS consumers listening on an ActiveMQ queue

查看:87
本文介绍了在ActiveMQ队列上侦听的所有JMS使用者的油门消耗率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用骆驼节流阀组件,您可以定义每个时间段内已使用消息的速率的上限,例如:

Using Camel Throttler component you can define an upper limit on the rate of consumed messages per time period, e.g.:

from("activemq:queueA").throttle(10).to("direct-vm:bla")

我认为不理想的是,骆驼节流器在节流器阻塞的情况下将交换保持在内存中。因此,如果您有100个队列使用方,并且由于任何原因 direct-vm:bla运行缓慢(例如,调用外部慢速服务),则您的内存中最多可能有100个交换!

What I see as non ideal is that Camel Throttler keeps the exchanges in-memory while they are blocked by the Throttler. So, if you have 100 queue consumers and for any reason the "direct-vm:bla" is slow (e.g. invoking external slow service), you may have in-memory up to 100 exchanges!

我想知道是否有ActiveMQ功能将限制要求强加在ActiveMQ级别上。甚至在每个队列级别。类似于HornetQ的Consumer-max-rate。

I was wondering if there is an ActiveMQ feature to impose the throttling requirement on the ActiveMQ level. Maybe even on a per queue level. Something similar to consumer-max-rate of HornetQ.

推荐答案

配置消费者使用事务(不必XA事务。如果只有一个其他端点,请使用本地JMS事务(请参阅:LLR事务方法)。如果骆驼路线失败,则消息回滚到代理。

Configure the consumer to use a transaction (doesn't have to be an XA transaction. If you only have 1 other endpoint use a local JMS transaction. see: LLR transaction approach). If the Camel route fails, the messages roll back to the broker.

这篇关于在ActiveMQ队列上侦听的所有JMS使用者的油门消耗率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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