Registry / messaging / kafka-clients

kafka-clients

JSON →
library4.3.0javamavenunverified

Apache Kafka clients library provides producer and consumer APIs for interacting with Apache Kafka clusters.

<dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>4.3.0</version> </dependency>
INSTALL
IMPORT
SIG · KAFKA-CLIENTS
K
kafka-clients
messagingjavav4.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KafkaProducer
org.apache.kafka.clients.producer.KafkaProducer

Sends a message to a Kafka topic using the producer API.

import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import java.util.Properties; public class KafkaExample { public static void main(String[] args) { Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); try (KafkaProducer<String, String> producer = new KafkaProducer<>(props)) { producer.send(new ProducerRecord<>("my-topic", "key", "value")); } } }
Debug
Known issues
breakingKafka clients 4.x may have breaking changes from 3.x, especially in configuration and API methods.
fix
Review the Kafka 4.0 migration guide for changes in producer/consumer APIs and configuration keys.
affects: >=4.0.0
Upgrade
Version history
4.3.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
kafka-clients — mvn dependency:get kafka-clients · libregistry