Class BrokerPollSystem<K,V>

java.lang.Object
io.confluent.parallelconsumer.internal.BrokerPollSystem<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
OffsetCommitter

public class BrokerPollSystem<K,V> extends Object implements OffsetCommitter
Subsystem for polling the broker for messages.
  • Constructor Details

  • Method Details

    • start

      public void start(String managedExecutorService)
    • supervise

      public void supervise()
    • drain

      public void drain()
      Will begin the shutdown process, eventually closing itself once drained
    • closeAndWait

      public void closeAndWait() throws TimeoutException, ExecutionException
      Throws:
      TimeoutException
      ExecutionException
    • retrieveOffsetsAndCommit

      public void retrieveOffsetsAndCommit()
      Optionally blocks. Threadsafe
      Specified by:
      retrieveOffsetsAndCommit in interface OffsetCommitter
      See Also:
    • wakeupIfPaused

      public void wakeupIfPaused()
      Wakeup if colling the broker
    • pausePollingAndWorkRegistrationIfRunning

      public void pausePollingAndWorkRegistrationIfRunning()
      Pause polling from the underlying Kafka Broker.

      Note: If the poll system is currently not in state running, calling this method will be a no-op.

    • resumePollingAndWorkRegistrationIfPaused

      public void resumePollingAndWorkRegistrationIfPaused()
      Resume polling from the underlying Kafka Broker.

      Note: If the poll system is currently not in state paused, calling this method will be a no-op.

    • isPaused

      public boolean isPaused()
      While paused is an externally controlled state that temporarily stops polling and work registration, the paused flag is used internally to pause subscriptions if polling needs to be throttled.
    • setLongPollTimeout

      public static void setLongPollTimeout(Duration longPollTimeout)
      Note how this relates to getLongPollTimeout() - if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand.
    • getLongPollTimeout

      public static Duration getLongPollTimeout()
      Note how this relates to getLongPollTimeout() - if longPollTimeout is high and loading factor is low, there may not be enough messages queued up to satisfy demand.