Skip to content

how use exclusive implements leader election ??i want know more details?? #17703

Answered by merlimat
startjava asked this question in Q&A
Discussion options

You must be logged in to vote

@startjava You can implement a "leader election" pattern using the "exclusive producer" feature.

Basically, if a certain producer is able to become the "exclusive producer" on the topic, it will assume itself the role of "leader". It is important though that all the decisions taken by the leader to be communicated as messages published in the topic.

There are few options to chose from when creating the exclusive producer:

  • Exclusive: Require exclusive access for producer. Gives error if there's already a producer
  • ExclusiveWithFencing: Acquire exclusive access for the producer. - Removes any existing producers
  • Shared: By default multiple producers can publish on a topic.
  • WaitForExclusive: …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by merlimat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants