Queue selectors
Selectors act as WHERE clauses in the JMS queue consumer. Selectors can be applied to message headers and properties in either a continuous or a sequential queue.
The following table lists how you can use continuous selectors in the JMS queue consumer.
| Type of queue | Where to identify selector |
|---|---|
|
Sequential queue |
Specified as a property of the cron task. |
|
Continuous queue |
Specified n the ejb-jar.xml code of the message-driven bean. |
Applying selectors splits a queue into smaller queues, each of which contains a subset of data that each cron task or message-driven bean uses. An error in one subset of the data does not stop processing in the others in a sequential queue.
While selectors provide flexibility in separating the processing of transactions, they impair the performance of poll processing. Depending on the volume of transactions, you can prefer to implement multiple queues instead of one queue with multiple selectors. Multiple queues typically provide better performance.
You can add the following statement to the SELECTOR property of the SEQQIN instance of the JMSQSEQCONSUMER to instruct the cron task to process the MXPOInterface and MXPRInterface transactions from the corresponding external system:
SENDER='EXTSYS1' and INTERFACE in (‘MXPOInterface', ‘MXPRInterface')
Add the following content to the message bean configuration in the ejb-jar.xml file to instruct the message-driven bean to process the MXPOInterface and MXPRInterface transactions from the corresponding external system:
<message-selector>
SENDER='EXTSYS1' AND INTERFACE IN (‘MXPOInterface', ‘MXPRInterface')
</message-selector>
If two external systems send data to an inbound sequential queue, an error in any record stops the processing of all transactions in that queue to maintain a first-in-first-out processing order. Create multiple instances of a cron task, each with a selector that processes a different external system, to prevent an error in one system from stopping transactions from the second system.
Ensure that the where clauses in the selectors identify the mutually exclusive sets of transactions in a sequential queue. Include all the transactions that are inserted into the queues to ensure that all messages are processed in a first-in-first-out order.