0

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?

Zakaria Hossain
  • 2,188
  • 2
  • 13
  • 24
coder
  • 231
  • 3
  • 11
  • 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 Answers1

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