Message Selector Performance
----------------------------

         Key: JBMQ-6
         URL: http://jira.jboss.com/jira/browse/JBMQ-6
     Project: JBoss MQ
        Type: Task
  Components: Server  
    Reporter: Adrian Brock
    Priority: Minor


Improving Message Selector Performance

It is a common anti-pattern for users to set up a contested queue
where multiple receivers try to take messages based on a message selector.
In most circumstances a Topic is what they should be using.

But there is a circumstance where a Topic does not work as required,
that is when a message matches many of the receiver's selector but you
only want one receiver to process the message (it doesn't matter which).

The problem is that when a receiver does not match a message towards
the top of a large Queue (or none at all). The operation to find a message
or discover there are no messages is very expensive. It is read and skip.
This can be even worse when the bottom of the queue has been moved out
to disk by the MessageCache.

The solution is to provide "an index" over a particular property,
e.g.
<mbean code="org.jboss.mq.server.jmx.Queue"
         name="jboss.mq.destination:service=Queue,name=A">
    <optimized-selector>JMSMessageID</optimized-selector>
    <depends 
optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>

This configuration should be passed via the BasicQueueParameters to the 
BasicQueue.

NOTE: This is irrevelent for Topics. Topics run their selector before the 
message is added
to the subscription, anything not matching the selector is dropped.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to