-
https://github.com/apache/pulsar/wiki/PIP-68%3A-Exclusive-Producer There are several use cases that require exclusive access for a single writer, of which few examples are: how use exclusive implements leader election ??i want know more details?? thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
about : |
Beta Was this translation helpful? Give feedback.
-
@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:
|
Beta Was this translation helpful? Give feedback.
@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 producerExclusiveWithFencing
: Acquire exclusive access for the producer. - Removes any existing producersShared
: By default multiple producers can publish on a topic.WaitForExclusive
: …