You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Enrico Olivelli - Diennea <en...@diennea.com> on 2016/07/27 10:25:48 UTC

Embedded Kafka Broker Health Check

Hi,
I'm running Kafka launching KafkaServerStartable inside my JVM (I'm using version 0.10.0.0).

I'm accessing the internal KafkaServer field using reflection
Field serverField = kafkaServer.getClass().getDeclaredField("server");
serverField.setAccessible(true);
KafkaServer server = (KafkaServer) serverField.get(kafkaServer);
byte state = server.brokerState().currentState();

What is the best way to ask KafkaServer its state ?

I see that the 'brokerState' is not very useful
Sometimes the server stops working, for instance due to ZK session expiration, but the broker remains in RunningAsBroker state.

Second question ? If it is not possibile to dig into Broker status (and in fact I would prefer not to do), is there some flag to auto-kill the broker in case of serious problems (ZK, Disk space....)

I can send some logs, but I prefer to treat it as a blackbox, as far as it is possible

Thank you


--
Enrico Olivelli
Software Development Manager @Diennea
Tel.: (+39) 0546 066100 - Int. 925
Viale G.Marconi 30/14 - 48018 Faenza (RA)

MagNews - E-mail Marketing Solutions
http://www.magnews.it
Diennea - Digital Marketing Solutions
http://www.diennea.com


________________________________

Iscriviti alla nostra newsletter per rimanere aggiornato su digital ed email marketing! http://www.magnews.it/newsletter/

The information in this email is confidential and may be legally privileged. If you are not the intended recipient please notify the sender immediately and destroy this email. Any unauthorized, direct or indirect, disclosure, copying, storage, distribution or other use is strictly forbidden.

Re: Embedded Kafka Broker Health Check

Posted by Enrico Olivelli <eo...@gmail.com>.
Hi,
Can someone help on this topic?
Thank you

Enrico

Il Mer 27 Lug 2016 12:26 Enrico Olivelli - Diennea <
enrico.olivelli@diennea.com> ha scritto:

> Hi,
> I'm running Kafka launching KafkaServerStartable inside my JVM (I'm using
> version 0.10.0.0).
>
> I'm accessing the internal KafkaServer field using reflection
> Field serverField = kafkaServer.getClass().getDeclaredField("server");
> serverField.setAccessible(true);
> KafkaServer server = (KafkaServer) serverField.get(kafkaServer);
> byte state = server.brokerState().currentState();
>
> What is the best way to ask KafkaServer its state ?
>
> I see that the 'brokerState' is not very useful
> Sometimes the server stops working, for instance due to ZK session
> expiration, but the broker remains in RunningAsBroker state.
>
> Second question ? If it is not possibile to dig into Broker status (and in
> fact I would prefer not to do), is there some flag to auto-kill the broker
> in case of serious problems (ZK, Disk space....)
>
> I can send some logs, but I prefer to treat it as a blackbox, as far as it
> is possible
>
> Thank you
>
>
> --
> Enrico Olivelli
> Software Development Manager @Diennea
> Tel.: (+39) 0546 066100 - Int. 925
> Viale G.Marconi 30/14 - 48018 Faenza (RA)
>
> MagNews - E-mail Marketing Solutions
> http://www.magnews.it
> Diennea - Digital Marketing Solutions
> http://www.diennea.com
>
>
> ________________________________
>
> Iscriviti alla nostra newsletter per rimanere aggiornato su digital ed
> email marketing! http://www.magnews.it/newsletter/
>
> The information in this email is confidential and may be legally
> privileged. If you are not the intended recipient please notify the sender
> immediately and destroy this email. Any unauthorized, direct or indirect,
> disclosure, copying, storage, distribution or other use is strictly
> forbidden.
>
-- 


-- Enrico Olivelli