Interface MessageReceiver

All Known Implementing Classes:
FilteringMessageReceiver, KafkaSingleThreadedMessageReceiver, ThrottlingMessageReceiver, UninitializedMessageReceiver

public interface MessageReceiver
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
    moveOffset(pl.allegro.tech.hermes.common.kafka.offset.PartitionOffset offset)
     
    Retrieves the next available message from the queue.
    default void
     
    default void
    update(pl.allegro.tech.hermes.api.Subscription newSubscription)
     
  • Method Details

    • next

      Optional<Message> next()
      Retrieves the next available message from the queue.

      Depending on the context, the returned Optional can contain:

      • A Message that contains a valid message ready to be sent.
      • A Message with the `isFiltered` flag set, indicating that the message has been filtered and should be skipped during processing or sending.
      • null, indicating that there are no messages currently available in the queue.
      Returns:
      an Optional containing the next Message if available; an Optional containing a filtered message if it should be skipped; or an empty Optional if there are no messages in the queue.
    • stop

      default void stop()
    • update

      default void update(pl.allegro.tech.hermes.api.Subscription newSubscription)
    • commit

      void commit(Set<SubscriptionPartitionOffset> offsets)
    • moveOffset

      boolean moveOffset(pl.allegro.tech.hermes.common.kafka.offset.PartitionOffset offset)