book
Article ID: KB0089631
calendar_today
Updated On:
Description
Resolution:
It depends on the destination that is used.
For topics:
When the server receives a message, it goes through the list of all potential consumers (consumers that subscribe directly to the topic or to a child topic). For each consumer, the server checks if the message satisfies the consumer's selector (if any). If the message passes the test, then the server delivers the message to the consumer.
Note that if all consumers for that topic use a selector and an incoming message is rejected by all consumers, the server will discard that message.
For queues:
When the server receives a message, if the queue is exclusive, the unique active receiver will receive the message if the receiver's selector (if any) does not reject that message.
If the queue is non-exclusive, and there are multiple receivers, the message is delivered in a round-robin fashion. If the candidate consumer has a selector, the server will evaluate the selector. If the message is not rejected, it is delivered to that consumer. Otherwise, the next consumer is evaluated, etc...
Note that if all consumers for that queue use a selector and an incoming message is rejected by all consumers, the message will be pending in the queue until a consumer accepting that message (no selector or selector accepting the message) is started.
In the case of an exclusive queue, this means that the message will be pending until the active consumer to the exclusive queue is stopped.
Issue/Introduction
How the message selector works on the server side?