Kafka Streams app will not work when Kafka cluster goes down

I have a Kafka Streams application (0.10.2.1). When I close the Kafka cluster, the streams application continues to wait for the next message, when the cluster is restored, it will resume message consumption. At a time when the cluster is disconnected, the application appears to work normally. I tested this for more than 45 minutes.

I would expect Kafka to make an exception or stop. I configured StateListenerto register when KafkaStreams shuts down, but it never gets called.

kafkaStreams.setStateListener((newState, _) => {
  if (newState == KafkaStreams.State.NOT_RUNNING) {
    Log.error("Kafka died unexpectedly.")
  }
})

How do I get Kafka to throw an exception or exit when it cannot connect to the cluster?

Note: this assumes that the cluster goes into after when the application started

+4
source share
1 answer

Why do you want the Kafka Streams app to drop?

, , , , , . Kafka Streams, , . , , , , parallelism, . , Kafka Streams . , .

, ( ), , Kafka Streams.

0

Source: https://habr.com/ru/post/1680452/


All Articles