Anuj Khandelwal
Anuj Khandelwal

Reputation: 845

ActiveMQ replicated levelDB with zookeeper

I want to understand zookeeper's role in replicated leveldb for ActiveMQ broker.

  1. About zookeeper election : How does zookeeper knows that out of all the clients connected to zookeeper, which clients are ActiveMQ brokers fighting to become master. Is there any particular key or configuration which is passed by all the brokers connecting to zookeeper which says that we (let say 3) ActiveMQ brokers belong to same environment and fighting to become master.

  2. At what interval slave broker copy data from master broker ? Any corner cases where data might be lost ?

  3. Does ActiveMQ provides guarantee of message ordering using replicated leveldb ? I am talking about the case when re-election of master happens while producer is sending messages in sequence to the broker?

Thanks,
Anuj

Upvotes: 3

Views: 1804

Answers (1)

Petter Nordlander
Petter Nordlander

Reputation: 22279

  1. By zkPath in the Zookeeper configuration and by broker name.
  2. Each message is synced to a quorum (nodes/2+1) brokers before the transaction completes. So there is no sync interval, it's synced in real time. The cluster will no function unless you have a quorum of brokers online so there should be no data loss.
  3. The messages are synced to a majority of the nodes in a synchronous fashion. At reelection, a node with the latest updates will be elected. Ordered messages should be no problem. However, it's generally problematic to rely critically on ordered messages in a message queueing. As a rule of thumb - message order will only be complete under "happy days". Dead letters, multiple consumers and so forth might as well mess up message order.

Upvotes: 5

Related Questions