Lets say I have topic: VirtualTopic.A and a Queue Consumer.B.VirtualTopic.A,
There are two consumer one subscribing to topic VirtualTopic.A and other on queue Consumer.B.VirtualTopic.A both are using selector?
Will there be any problem because of using selectors?
Will selector make dispatching from queue slow?
Selectors will make dispatching slightly slow*er*, but will it make it
*slow*? That depends on your setup, and no one but you will be able to
answer performance questions about your usecase, your configuration, and
your hardware. Try it and see; that's the only way you're going to know
whether your performance is acceptable; anyone else's experience isn't
going to give you more than a guess as to whether things will be OK for
your particular setup.
With that being said, my guess is that it'll be fine, because the feature
wouldn't have made it into production if it immediately destroyed
performance. But that's just a guess, because I don't know the details of
> Lets say I have topic: VirtualTopic.A and a Queue
> There are two consumer one subscribing to topic VirtualTopic.A and other on
> queue Consumer.B.VirtualTopic.A both are using selector?
> Will there be any problem because of using selectors?
> Will selector make dispatching from queue slow?
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Selector-and-Virtual-Topic-tp4689544.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
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
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.