This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

JMS Selectors

This sample demonstrates how message selectors work when receiving messages from a JMS queue. It has a client which performs the role of a queue sender and another client which performs the role of a queue selector receiver. The queue selector receiver filters the messages it reads from the queue based on a selector string. 

About the sample

The <MB_HOME>/Samples/JMSSelectors/src/org/sample/jms directory has the following classes:

Prerequisites

See Prerequisites to Run the MB Samples for a list of prerequisites.

Building the sample

Run the ant command from the <MB_HOME>/samples/JMSSelectors directory.

Analyzing the output

The following output log will appear in your console.

     [java] Starting Queue Listener....
     [java] JMS Selector : Currency ='LK' AND quantity < 3
     [java] Starting Queue Sender....
     [java] Send Message from QueueSender : Currency = LK , Quantity = 1 
     [java] Send Message from QueueSender : Currency = USD 
     [java] Send Message from QueueSender : Currency = LK , Quantity = 4 
     [java] Send Message from QueueSender : Currency = EUR 
     [java] Send Message from QueueSender : Currency = LK , Quantity = 5 
     [java] Send Message from QueueSender : Currency = LK , Quantity = 6 
     [java] Got message from queue receiver with conforming to selectors ==>Test Message Content with properties LK & 1