Class SerialConsumer

java.lang.Object
pl.allegro.tech.hermes.consumers.consumer.SerialConsumer
All Implemented Interfaces:
Consumer

public class SerialConsumer extends Object implements Consumer
  • Constructor Details

  • Method Details

    • consume

      public void consume(Runnable signalsInterrupt)
      Description copied from interface: Consumer
      Consume **must** make sure that interrupted status is restored as it is needed for stopping unhealthy consumers. Swallowing the interrupt by consume or any of its dependencies will result in consumer being marked as unhealthy and will prevent commits despite messages being sent to subscribers.
      Specified by:
      consume in interface Consumer
    • initialize

      public void initialize()
      Specified by:
      initialize in interface Consumer
    • tearDown

      public void tearDown()
      Try to keep shutdown order the same as initialization so nothing will left to clean up when error occurs during initialization.
      Specified by:
      tearDown in interface Consumer
    • updateSubscription

      public void updateSubscription(pl.allegro.tech.hermes.api.Subscription newSubscription)
      Specified by:
      updateSubscription in interface Consumer
    • updateTopic

      public void updateTopic(pl.allegro.tech.hermes.api.Topic newTopic)
      Specified by:
      updateTopic in interface Consumer
    • commit

      public void commit(Set<SubscriptionPartitionOffset> offsets)
      Specified by:
      commit in interface Consumer
    • moveOffset

      public boolean moveOffset(pl.allegro.tech.hermes.common.kafka.offset.PartitionOffset offset)
      Specified by:
      moveOffset in interface Consumer
    • getSubscription

      public pl.allegro.tech.hermes.api.Subscription getSubscription()
      Specified by:
      getSubscription in interface Consumer