0

I have following two questions related to distributed messaging system.

  1. How is topic different from Queue?
  2. How are subscribers maintained in case of topics.

Please share any document or link which can be helpful to understand these concepts. Thanks

Ashwani K
  • 7,880
  • 19
  • 63
  • 102
  • Care to comment why it was down voted? – Ashwani K Oct 08 '15 at 11:17
  • 1
    I think a good place to start for you is [here](http://kafka.apache.org/documentation.html#introduction) to see how Kafka topics are designed. Your question seems too broad to me but I'll be glad to answer more specific questions if you will have them. – serejja Oct 08 '15 at 12:30
  • @serejja: Thanks for the link. – Ashwani K Oct 09 '15 at 09:56

1 Answers1

1
  1. ActiveMQ website has a pretty good explanation. Quoted here.

Topics

In JMS a Topic implements publish and subscribe semantics. When you publish a message it goes to all the subscribers who are interested - so zero to many subscribers will receive a copy of the message. Only subscribers who had an active subscription at the time the broker receives the message will get a copy of the message.

Queues

A JMS Queue implements load balancer semantics. A single message will be received by exactly one consumer. If there are no consumers available at the time the message is sent it will be kept until a consumer is available that can process the message. If a consumer receives a message and does not acknowledge it before closing then the message will be redelivered to another consumer. A queue can have many consumers with messages load balanced across the available consumers. So Queues implement a reliable load balancer in JMS.

2. Topic subscribers, as well as queue consumers are maintained in the broker. However, subscribing clients can make the subscription durable and let the broker remember it when it goes offline. A subscriber is identified by a client id.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84