activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artnaseef <...@artnaseef.com>
Subject Re: Request / Reply in Network of Brokers
Date Thu, 08 May 2014 03:23:40 GMT
Oh, and by the way, please be careful with request/reply using selectors. 
While the JMS spec says this is feasible, you'll find concerns with ActiveMQ
that need to be carefully considered.

For example, selectors cause a fair amount of processing, and every message
is evaluated against every consumer's selector until a match is found -
meaning that, on average, 50% of the selectors will be evaluated on every
message dispatch (assuming equal chance of matching every selector and every
consumer having a selector).  There is no optimization within ActiveMQ to
pinpoint the right consumer based on the selector and headers.

Another concern here is rapid creation and removal of consumers in order to
get new selectors.  Such rapid creation is an antipattern with ActiveMQ. 
One idea to work around this problem is to avoid a correlation ID per
request, and instead use a header with a fixed value assigned to the
consumer.  Then that one consumer keeps the same selector for its lifetime,
and can handle any number of responses.

Hope this helps.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-Reply-in-Network-of-Brokers-tp4680957p4680977.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message