I have two subscribers, subscribed to same query, but I want only one to consume it. How can I achieve it using map or something else?
Asked
Active
Viewed 44 times
0
-
What do you mean by _query_? Messages published to a topic will be received by all subscribers. Messages published to a queue will be received by only one of the subscribers. Possibly terminology conflict - see pub/sub vs message queue. – Andrew S Oct 16 '18 at 19:05
1 Answers
0
If you only want one consumer to get the message, use queue receivers instead of topic subscribers. The purposes of queues is exactly that: one-to-one delivery. See also this discussion: JMS Topic vs Queues

Axel Podehl
- 4,034
- 29
- 41