Apart from Sender selector, a JMS selector can also be defined which checks for a particular value for a JMS message property and routes the message depending on that.
Defining a JMS Selector
To provide a JMS property, select the route, click Selectors property tab and provide a property along with the corresponding value
Example
Below is an example with a scenario and the corresponding steps explained.
Scenario
Consider a flow with a feeder and a display connected by a route. Define a selector on the route which allows only those messages which have a property 'testProperty' with value chk.
Steps
To create a JMS selector as mentioned in the scenario,
Click the route and type-in the following text in the JMS text box under Selectors properties tab and save the event process.
testProperty='chk'
Figure 1: Configuring JMS Selector on route
- Run the Event Process after checking resource and connectivity.
- Add the testProperty property to the input message sent from Feeder. To do this, edit the Name and Value columns by clicking Add button under Headers & Attachments tab in the feeder; the message sent will be filtered based on the value.
Figure 2: Setting property value on a message from Feeder Display window shows the message received, as the properties match the ones that were given under JMS Selectors property.