Class ConsumerNetworkThread

java.lang.Object
java.lang.Thread
org.apache.kafka.common.utils.KafkaThread
org.apache.kafka.clients.consumer.internals.ConsumerNetworkThread
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable

public class ConsumerNetworkThread extends org.apache.kafka.common.utils.KafkaThread implements Closeable
Background thread runnable that consumes ApplicationEvent and produces BackgroundEvent. It uses an event loop to consume and produce events, and poll the network client to handle network IO.
  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • isRunning

      public boolean isRunning()
    • wakeup

      public void wakeup()
    • maximumTimeToWait

      public long maximumTimeToWait()
      Returns the delay for which the application thread can safely wait before it should be responsive to results from the request managers. For example, the subscription state can change when heartbeats are sent, so blocking for longer than the heartbeat interval might mean the application thread is not responsive to changes. Because this method is called by the application thread, it's not allowed to access the request managers that actually provide the information. As a result, the consumer network thread periodically caches the information from the request managers and this can then be read safely using this method.
      Returns:
      The maximum delay in milliseconds
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • close

      public void close(Duration timeout)