Hello Javier,

Matthias is right it is a known issue, not only in Streams, but in the
underlying producer / consumer clients.

For you own healthcheck monitoring, I'd suggest you can consider some
following alternatives:

1) Monitor on consumer offsets, and alert when it did not change for a long
time.

2) Obviously not all scenarios of 1) above is contributed from lost
connection, so in addition to it you can also monitor on the embedded
consumer / producer's bytes-in / bytes-out rate, and alert when it drops to
zero for some time.

Combining 1) with 2), when both happens, it is usually indicating a lost
connection situation.


Guozhang


On Wed, Feb 20, 2019 at 9:39 AM Matthias J. Sax <[email protected]>
wrote:

> It's a known issue: https://issues.apache.org/jira/browse/KAFKA-6520
>
>
> On 2/20/19 3:25 AM, Javier Arias Losada wrote:
> > Hello Kafka users,
> >
> > working on a Kafka-Streams stateless application; we want to implement
> some
> > healthchecks so that whenever connection to Kafka is lost for more than a
> > threshold, marke the instance as unhealthy, so that our cluster manager
> > (could be K8S or AWS-ECS) kills that instance and starts a new one.
> >
> > We have notice that when the consumer is running and the connection is
> > lost, it tries to reconnect and sends some logs, but we didn't find a way
> > to programatically check or subscribe to the connection status.
> >
> > Am I missing something?
> > Is this an intended feature? Why?
> > What are the best practices for healtchecking Kafka-streams applications?
> >
> > I also found that with a plain Kafka consumer, no exception is raised on
> > lost connectivity... how could we somehow check the connection status?
> How
> > are other people solving this issue?
> >
> > Thank you very much.
> >
>
>

-- 
-- Guozhang

Reply via email to