activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From artnaseef <...@artnaseef.com>
Subject Re: Selector and Virtual Topic
Date Wed, 07 Jan 2015 23:57:15 GMT
That's close.  Selectors can be terrible for performance.

The way ActiveMQ applies selectors is like this:

  ON MESSAGE DISPATCH
    WHILE ( message is NOT dispatched ) AND ( more consumers exist )
       IF selector matches
       THEN
         DISPATCH message
       END IF

The problem for performance comes with large numbers of consumers with
distinct selectors.  In this case, dispatch of messages performs on the
order of O(n) - for every message - where "n" is the number of consumers. 
So, 1000 consumers in a worst-case-scenario will take about 1000 times
longer to get through this dispatch loop compared to 1 consumer.

Be careful with selectors.  They have been known to kill performance of a
solution.

With that said, the scenario described will work.  The queue and topic
subscribers have their own selectors and in no way compete for messages.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Selector-and-Virtual-Topic-tp4689544p4689626.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message