JMS Message Selectors
The Local Actor API v2 uses JMS-style message selectors for selecting message broker "capabilities" when creating deliveries and subscriptions. These selectors are SQL-like expressions that match against capability definitions.
Capability Selection
A "capability" describes a stream of messages by defining which AMQP application properties all messages in that stream have. When creating a delivery or subscription via the REST API, you specify a selector
parameter that determines which capabilities should be included. The system then figures out which capabilities would contain messages that meet the selector's criteria and includes these capabilities in the delivery or subscription.
AMQP Link Filtering
Selectors can also be used at the AMQP level by applying them directly to AMQP links. This mainly applies when receiving messages, where the selector acts as a server-side filter that actually filters the messages themselves before they are transmitted to the client. This provides more efficient message filtering by reducing network traffic and client-side processing.
Examples
messageType = 'DENM'
- Selects capabilities that provide messages with messageType property equal to 'DENM'publicationId = 'XX99999:TEST'
- Selects capabilities that provide messages with a specific publication IDmessageType IN ('CAM', 'DENM')
- Selects capabilities that provide messages with messageType of either 'CAM' or 'DENM'quadTree LIKE '%,10013%'
- Selects capabilities that provide messages in QuadTile area 10013 (see QuadTiles for more details on geographical filtering)
References
- https://activemq.apache.org/components/classic/documentation/selectors
- https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=messages-message-selectors-in-jms
- https://www.ibm.com/docs/en/integration-bus/10.1?topic=bus-jms-message-selector
- https://docs.oracle.com/cd/E19957-01/816-5904-10/816-5904-10.pdf (chapter 3.8.1)