Overview of the confluent_kafka API
masterThe confluent_kafka library is a reliable, performant, and feature-rich Python client for Apache Kafka (v0.8 and above). It provides several high-level APIs for interacting with Kafka, including producers, consumers, and administrative tools.
Core Client APIs
- Producer: For sending messages to Kafka topics.
- Consumer: For reading messages from Kafka topics.
- ShareConsumer: For using Kafka's shared consumer capabilities (Queues for Kafka).
- AdminClient: For managing Kafka cluster resources (topics, configs, ACLs, etc.).
- SchemaRegistryClient: For interacting with the Confluent Schema Registry to manage Avro, JSON Schema, and Protobuf schemas.
Serialization API
The library supports various serialization and deserialization formats:
- Avro
- JSON Schema
- Protobuf
- String
- Integer
- Double
Experimental and Legacy APIs
- Experimental:
SerializingProducer,DeserializingConsumer, andDeserializingShareConsumer. These are subject to breaking changes. It is recommended to use (de)serializers directly instead. - Legacy (Deprecated):
AvroConsumerandAvroProducer. These will be removed in a future version.