Appendix E. JMS Message Selector Syntax


JMS message selectors are used by JMS clients to filter the messages that a JMS server delivers to a given MessageConsumer. A message selector is provided (optionally) when a MessageConsumer is created, using either the QueueSession. createReceiver( ) or the TopicSession.createSubscriber( ) method.

A message selector is a string that specifies a predicate to be applied to each message that the provider wants to deliver to a MessageConsumer. If the predicate evaluates to true, then the message is delivered; if false, then the message is not delivered. In point-to-point messaging, when messages are filtered out by a message selector, the message will remain on the queue until the client eventually reads it or the message times out and the server removes it from the queue. In publish-subscribe messaging, messages that are filtered are never delivered to the subscriber.

In this chapter, we provide the full syntax of JMS message selectors. For more details on using JMS in general, see the tutorial in Chapter 11.



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net