Kafka producer
A Kafka producer is an application or client that publishes records to Kafka topics.
Apache Kafka in Action
A producer is an application or service that publishes records to Kafka topics.
- How it is used
- Publishes records to topics so independent consumers can process current or retained data.
- How deep it goes
- Traces serialization, partitioning, buffering, and sending, then identifies acknowledgment and failure-handling decisions.
- Examples
- Uses console commands to publish product-price updates and parallel producer and consumer windows to observe their flow.
- What you can do after
- Apply it via kafka-console-producer.sh to publish updates, then evaluate partitioning and reliability choices for application producers.
Kafka Streams in Action, Second Edition
KafkaProducer is the Kafka client API class that publishes records to Kafka topics.
- How it is used
- Publishes application records to Kafka topics as the entry point for event-driven and event-streaming applications.
- How deep it goes
- Explains configuration, record construction, asynchronous sending, batching, callbacks, and schema integration, then defers advanced delivery semantics.
- Examples
- Uses a wholesale sales-ingest pipeline, generated ProductTransaction objects, customer keys, callbacks, offsets, and timestamps.
- What you can do after
- Builds a Java producer that converts domain objects into records, sends them asynchronously, and handles delivery results.
Read how Kafka Streams in Action, Second Edition explains Kafka producer →
Related concepts
- MockProducerimplemented by · MockProducer is the Kafka client test class that implements Producer behavior without requiring a live Kafka broker.
- Apache Kafkauses · Apache Kafka is a distributed event-streaming platform for publishing, storing, processing, and consuming streams of records.
- partitioneruses · A partitioner is a component or algorithm that determines the partition to which a record is routed.
- ProducerRecorduses · ProducerRecord is a Kafka client API type that represents a record sent by a producer, including its destination topic and optional partition, key, timestamp, and value.
- StreamPartitionerconfigures · StreamPartitioner is a Kafka Streams interface for determining the output partition assigned to a record.
- callbackuses · A callback is a function or other callable supplied to software for invocation later in response to a specified event, condition, or point in execution.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

