KafkaHealthcheck

KafkaHealthcheck registers the broker it runs on with Zookeeper (which in turn makes the broker visible to other brokers that together can form a Kafka cluster).

KafkaHealthcheck is created and started when KafkaServer is requested to start up.

KafkaHealthcheck.png
Figure 1. KafkaHealthcheck
Table 1. KafkaHealthcheck’s Internal Properties (e.g. Registries and Counters)
Name Description

sessionExpireListener

SessionExpireListener

Creating KafkaHealthcheck Instance

KafkaHealthcheck takes the following when created:

  • Broker ID

  • Advertised endpoints

  • ZkUtils

  • Optional rack name

  • ApiVersion

KafkaHealthcheck initializes the internal registries and counters.

Starting Up — startup Method

startup
Note
startup is used exclusively when KafkaServer starts up.

Registering Broker in Zookeeper — register Method

register(): Unit

register reads com.sun.management.jmxremote.port System property or defaults to -1.

For every EndPoint with no host assigned (in advertisedEndpoints), register assigns the fully-qualified domain name of the local host.

register then finds the first EndPoint with PLAINTEXT security protocol or creates an empty EndPoint.

Tip
Define EndPoint with PLAINTEXT security protocol for older clients to connect.

In the end, register requests ZkUtils to registerBrokerInZk for brokerId, the host and port of the PLAINTEXT endpoint, the updated endpoints, the JMX port, the optional rack and protocol version.

Note
register makes a broker visible for other brokers to form a Kafka cluster.
Note
register is used when KafkaHealthcheck starts up and handles a new session.

handleNewSession Method

Caution
FIXME

results matching ""

    No results matching ""