Class AtomixPartitionMessagingService
java.lang.Object
io.camunda.zeebe.broker.system.partitions.impl.AtomixPartitionMessagingService
- All Implemented Interfaces:
PartitionMessagingService
-
Constructor Summary
ConstructorsConstructorDescriptionAtomixPartitionMessagingService(ClusterCommunicationService communicationService, ClusterMembershipService clusterMembershipService, Collection<MemberId> members) -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcast(String subject, ByteBuffer payload) Broadcasts the given payload to all other members of the partition; should log if a member is not subscribed to a given topic, but not fail.voidsubscribe(String subject, Consumer<ByteBuffer> consumer, Executor executor) Subscribes to a given subject - if another member of the partition sends a message on this topic, the consumer will be notified with the given payload.voidunsubscribe(String subject) Unsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer.
-
Constructor Details
-
AtomixPartitionMessagingService
public AtomixPartitionMessagingService(ClusterCommunicationService communicationService, ClusterMembershipService clusterMembershipService, Collection<MemberId> members)
-
-
Method Details
-
subscribe
Description copied from interface:PartitionMessagingServiceSubscribes to a given subject - if another member of the partition sends a message on this topic, the consumer will be notified with the given payload. Each call is considered a new subscription.- Specified by:
subscribein interfacePartitionMessagingService- Parameters:
subject- the subject to subscribe toconsumer- the consumer which handles the payloadexecutor- the executor on which the consumer is called
-
broadcast
Description copied from interface:PartitionMessagingServiceBroadcasts the given payload to all other members of the partition; should log if a member is not subscribed to a given topic, but not fail.- Specified by:
broadcastin interfacePartitionMessagingService- Parameters:
subject- the subject on which to broadcast the payloadpayload- the payload to send
-
unsubscribe
Description copied from interface:PartitionMessagingServiceUnsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer. If none registered, does nothing.- Specified by:
unsubscribein interfacePartitionMessagingService- Parameters:
subject- the subject from which to unsubscribe
-