This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com