Automatically restart Kafka Stream in java

Viewed 375

The problem that I am facing is my Kafka Stream(1 thread) goes down unexpectedly due to some error. What I want to do is that if there is an error in Kafka stream consumer, it is identified and the stream is restarted automatically via a cron so that it removes the pain of constantly monitoring it. Is there any appropriate way to do this?

Until now I have tried using stream.start() on the same stream instance that got the error but it didn't work.

1 Answers

You can not reuse a stream right now. However in 2.8 (a few months away) there is plans to allow for stream threads to be replaced in a handler.

Related