[jboss-user] [JBoss Messaging] - Re: Selector Help needed - Possible alternative suggestions

timfox do-not-reply at jboss.com
Sun Jun 24 11:04:08 EDT 2007


In general it's a bad idea to use selectors with queues since it requires the entire queue to be scanned every time delivery is attempted (slow).

In most cases this can be refactored into using a topic with durable subscriptions - one durable subscription for each of your consumer types.

The selector on the durable sub is evaluated *before* the messages reach the durable sub, so it is much more efficient. (Think of each durable subscription of a queue, but it only contains those messages which match the selector).

Durable subscriptions can be clustered in JBM so you can have more than one consumer on the same durable subscription on different nodes of the cluster.

(There is an issue with message redistribution in 1.3.0 which reduces performance for this, but this will be fixed in 1.4.0.)

The issue about a message consumer getting "all" the messages is because each message consumer buffers ("prefetches")  into its local buffer. This is done for performance reasons. For high throughput it is much more efficient not having to go the server every time you want a message.

If this is a problem for you, you can reduce the prefetch size - this is explained in the userguide.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057186#4057186

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057186



More information about the jboss-user mailing list