Search⌘ K

Apache Kafka Java Client Library

Learn about the packages in the Kafka Java client library and the purpose they serve.

The Kafka Java client library allows JVM-based applications to interact with the Kafka cluster. Let’s look at the package structure, along with the key classes/interfaces.

Packages in the Kafka Java client library
Packages in the Kafka Java client library

Here are some of the important packages in the Kafka Java client library:

  • org.apache.kafka.clients.*: This contains the Producer, Consumer, and Admin API classes.

  • org.apache.kafka.connect.*: This is used to build source and sink connectors.

  • org.apache.kafka.streams.*: This is used to build stream processing applications.

  • org.apache.kafka.common.*: This deals with cross-cutting concerns like security, error handling, etc.

Let’s explore some of the classes/interfaces across some of these packages. You will see them in action throughout this course, and now is a good time to get familiar with them.

The org.apache.kafka.clients.producer library

  • KafkaProducer: An instance of this class ...