Using selectors in exclusive queue
mwis
Member Posts: 3 ✭
Hi
I'm trying to use exclusive queue with many consumers with different selectors.
For some reason after starting application and providing consumers only first one stays active.
Used library is JCSMP.
var flowProps = new ConsumerFlowProperties();
flowProps.setEndpoint(queue);
flowProps.setAckMode(JCSMPProperties.SUPPORTED_MESSAGE_ACK_CLIENT);
if (StringUtils.hasText(selector)) {
flowProps.setSelector(selector);
}
session.createFlow(listener, flowProps, endpointProperties);
Did I miss some configuration?
Used PubSub+ image: solace-pubsub-enterprise:10.4.1.59
JCSMP version: com.solacesystems:sol-jcsmp:10.3.1
I'm trying to use exclusive queue with many consumers with different selectors.
For some reason after starting application and providing consumers only first one stays active.
Used library is JCSMP.
var flowProps = new ConsumerFlowProperties();
flowProps.setEndpoint(queue);
flowProps.setAckMode(JCSMPProperties.SUPPORTED_MESSAGE_ACK_CLIENT);
if (StringUtils.hasText(selector)) {
flowProps.setSelector(selector);
}
session.createFlow(listener, flowProps, endpointProperties);
Did I miss some configuration?
Used PubSub+ image: solace-pubsub-enterprise:10.4.1.59
JCSMP version: com.solacesystems:sol-jcsmp:10.3.1
0
Best Answer
Answers
-
Hi @mwis, to understand your setup:
You have ONE exclusive queue, you want to consume different messages (based on different selectors) from different consumers from this queue.
Correct ?
This wont work (as described), because only ONE consumer can consume from an exclusive queue at the same time. That is the meaning of "exclusive".
Your setup will work, if you change the queue from "exclusive" to "non-exclusive".Uli
0 -
Hi @uherbst
Yes, setup is correct.
Documentation says something like this:
Queue consumer
When a consumer binds to an exclusive queue, the messages that it can consume are filtered by the selector defined for the consumer. The messages excluded by the consumer’s selector remain in the queue and can be consumed by subsequent consumers with different selectors or no selectors that might bind. Selectors act as egress filters on queues.
From my point of view can be consumed means that it should work with different selectors (filters).
Could you change description to be more exact on how it works if my understanding is incorrect?
Mateusz0