开发者

ActiveMQ: Is MessageConsumer's selector process on the broker or client side?

开发者 https://www.devze.com 2023-02-28 15:53 出处:网络
Could someone please confirm if I\'m right or wrong on this. It seems to me that \"selector\" operation is done within MessageConsumer implementation.(i.e. ALL messages are still dispatched from Messa

Could someone please confirm if I'm right or wrong on this. It seems to me that "selector" operation is done within MessageConsumer implementation. (i.e. ALL messages are still dispatched from Message Broker to MessageConsumer and then "selector" operation are performed against those messages). The problem occurs when we have a bunch of messages that we are not interested in (i.e. not match our selector), those messages will eventually fill up MessageConsumer's internal queue due to prefetch or cache limit. As a result, we will not be able to receive any new messages, particularly the ones we're interested in with the selector.

So, is there a way to configure AMQ to perform the selector operation 开发者_JAVA技巧on MessageBroker side? Should I start looking at "interceptor" and create my own BrokerPlugin? Any advice on how to workaround this issue?

I'm really appreciate any answer.

Thanks, Soonthorn A.


Selectors actually are applied at the broker, not on the client side. If your selector is sparse and the destination sees a lot of traffic its likely that the broker has not paged in messages that match the selector and you consumer won't see any matches until more messages are consumed from the destination.

The issue lies in the Destination Policy in play for your broker. By default the broker will only page in 200 message for a browser to avoid using up all available memory and avoid impacting overall performance. You can increase this number via your own DestinationPolicy in activemq.xml, see the documentation page here.

0

精彩评论

暂无评论...
验证码 换一张
取 消