Contents

 

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,

  1. 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
     

  2. Run the Event Process after checking resource and connectivity.
     
  3. 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

  4. Display window shows the message received, as the properties match the ones that were given under JMS Selectors property. 

Icon
  • Try sending messages with different properties other than what is set for JMS under Selectors and notice that only the messages with the matching properties gets through and appears in the Display window.
  • Similarly, to select all the messages whose value of the testProperty is not chk, create a JMS selector with the expression testProperty<>'chk'
Adaptavist ThemeBuilder EngineAtlassian Confluence