aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Message Selectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Message Selectors" Watch "Message Selectors" New topic
Author

Message Selectors

Shobana Niranjan
Greenhorn

Joined: Sep 03, 2002
Posts: 8
How do we write a message selector whose values for the variables are known only at runtime? I have to write a mdb that selects specific messages using a selector.Though the names of the variables will be known , the values of the variables will be known only at runtime.(dependant on the database). Any suggestions?
Thanks in advance
Amit G Piplani
Ranch Hand

Joined: Jul 21, 2004
Posts: 83
Hi,
Then you have to go for QueueSession's createReceiver method
public QueueReceiver createReceiver(Queue queue,
java.lang.String messageSelector)
throws JMSExceptionCreates a QueueReceiver object to receive messages from the specified queue using a message selector.
Parameters:
queue - the Queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a receiver due to some internal error.
InvalidDestinationException - if an invalid queue is specified.
InvalidSelectorException - if the message selector is invalid.

MessageSelector should have the check/condition for the given property


SCJP,SCWCD,SCBCD,SCDJWS1.4, SCDJWS1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Message Selectors