Interface PartitionMessagingService

All Known Implementing Classes:
AtomixPartitionMessagingService

public interface PartitionMessagingService
Abstracts away messaging to other members of a partition - add operations as needed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    broadcast(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.
    void
    subscribe(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.
    void
    Unsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer.
  • Method Details

    • subscribe

      void subscribe(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. Each call is considered a new subscription.
      Parameters:
      subject - the subject to subscribe to
      consumer - the consumer which handles the payload
      executor - the executor on which the consumer is called
    • broadcast

      void broadcast(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.
      Parameters:
      subject - the subject on which to broadcast the payload
      payload - the payload to send
    • unsubscribe

      void unsubscribe(String subject)
      Unsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer. If none registered, does nothing.
      Parameters:
      subject - the subject from which to unsubscribe