Class AtomixPartitionMessagingService
- java.lang.Object
-
- io.camunda.zeebe.broker.system.partitions.impl.AtomixPartitionMessagingService
-
- All Implemented Interfaces:
PartitionMessagingService
public class AtomixPartitionMessagingService extends Object implements PartitionMessagingService
-
-
Constructor Summary
Constructors Constructor Description AtomixPartitionMessagingService(ClusterCommunicationService communicationService, ClusterMembershipService clusterMembershipService, Collection<MemberId> members)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbroadcast(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 Detail
-
AtomixPartitionMessagingService
public AtomixPartitionMessagingService(ClusterCommunicationService communicationService, ClusterMembershipService clusterMembershipService, Collection<MemberId> members)
-
-
Method Detail
-
subscribe
public void subscribe(String subject, Consumer<ByteBuffer> consumer, Executor executor)
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
public void broadcast(String subject, ByteBuffer payload)
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
public void unsubscribe(String subject)
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
-
-