Message filters
You can filter the way messages are received in two different ways: Java Message Service (JMS) filters and HCL OneTest API filters.
Java™ Message Service (JMS) filters
The Message Selector field under Subscriber Configuration (see Subscriber options) accepts standard JMS filtering expressions (message selectors). When used, HCL OneTest™ API receives only messages that match the specified selector.
For example, if MyId='585858'
is
entered, only messages with the header field "MyId" having a value
of 585858 is received. To send matching messages in an
HCL OneTest™ API publisher, you would configure a message property as shown.
![](../images/jms_message_filter.jpg)
HCL OneTest™ API filters
After messages are passed to HCL OneTest™ API, they can be further filtered, using header and body fields, with the configuration in the Filter tab.
![](../images/ems_filter_tab.jpg)
In this case, JMSDestination must equal "business.inventory global" and JMSCorrelationID must equal "32458". Otherwise, HCL OneTest™ API discards the message.