Apache Kafka Java Client Library
Understand the structure and main components of the Apache Kafka Java client library. Learn about important packages and classes that enable JVM applications to interact with Kafka, including producers, consumers, and stream processing tools. Gain familiarity with Kafka APIs essential for developing real-time data streaming and processing applications.
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.
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 ...