Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When a Kafka Streams application is started, and then is unable to connect (docker daemon for instance is killed), then the user does not have an easy way of identifying the current state of Kafka Streams (i.e. does not know that its DISCONNECTED). For users who wish to know the status of their application, they would have to use alternative means of performing a health check. This KIP works to resolve this issue by adding a DISCONNECTED state to KafkaStreams#state()method to check for connection.

Public Interfaces

In Kafka Streams, State.DISCONNECTED  will a method KafkaStreams#isConnected() will be added. When  When something happens unexpectedly which causes the connection to vanish, the Kafka Streams application will return State.DISCONNECTED KafkaStreams#isConnected() will return false. Please note that the difference between DISCONNECTED  and DEAD  is that KafkaStreams, when it is in its dead state, is no longer running. While in the DISCONNECTED  case, it would still be alive, but could not connect to broker. KafkaStreams#isConnected  will look like this:

Code Block
languagejava
themeEclipse
titleKafkaStreams#isConnected()
/**
 * Indicates whether or not all of the threads are fully connected
 * 
 * @return the connection state of the threads
 */
public boolean isConnected();


This would also mean that a new method would be added to KafkaConsumer to allow the StreamThread to query the health of the connection.

...