All known brokers discovered from cluster metadata.
Current lifecycle state.
Create an admin client bound to this client.
The client must be connected before creating an admin client.
Optionaloptions: KafkaAdminOptionsAdmin-specific options.
A new KafkaAdmin instance.
Connect to the Kafka cluster.
Discovers brokers via the Metadata API and establishes the connection pool. Must be called before using producer, consumer, or admin clients.
Calling connect() on an already-connected client is a no-op.
Create a consumer bound to this client.
The client must be connected before creating a consumer.
Consumer-specific options.
A new KafkaConsumer instance.
Create a producer bound to this client.
The client must be connected before creating a producer.
Optionaloptions: KafkaProducerOptionsProducer-specific options.
A new KafkaProducer instance.
Top-level Kafka client.
Manages the connection pool and provides the entry point for producing, consuming, and administering Kafka clusters.
Example