3

I am trying my hands on apache ActiveMQ i have made my first application using spring.i am now trying to implementing publisher/subscriber application where all the peers can take participate in publishing at any time and the subscribers will recieve whatever is published. while Googling, have came across the terms Topic and the Concurrent consumers of the queue, now i am bit confused. i have few questions regarding it :

  1. How they both are different ?
  2. Which could the purpose here more efficiently ?
Bruce_Wayne
  • 1,564
  • 3
  • 18
  • 41

1 Answers1

3

Concurrent consumers on a queue compete for messages in the queue. Exactly one consumer receives each message. Concurrent consumers in a container are usually used to improve performance, as long as message order is not important.

Competing Consumers is when more than one consumer competes for messages in a queue. This could be multiple containers or multiple concurrent consumers within a single container.

Consumers on a topic all receive each message (as long as currently subscribed, or the subscription is durable - which is not the default).

When listening to a topic, you would usually only have one consumer per container.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179