liveBook · Manning

KafkaTemplate

KafkaTemplate is a Spring for Apache Kafka API class that provides high-level operations for sending records to Kafka topics.

How 2 Manning books explain it

Kafka Streams in Action, Second Edition

KafkaTemplate is a Spring Kafka class that provides high-level methods for sending records to Kafka topics.

How it is used
Publishes processed loan application records from Spring components to selected Kafka topics.
How deep it goes
Explains constructor injection, send arguments, completion callbacks, and concurrent sharing; defers Java threading and synchronization.
Examples
Uses a loan processor that routes approved or rejected applications and optionally copies results to a QA topic.
What you can do after
Apply it via Spring Kafka to send keyed records and attach callbacks that log broker-produced metadata or errors.

Read how Kafka Streams in Action, Second Edition explains KafkaTemplate →

Spring in Action, Sixth Edition

KafkaTemplate is a Spring for Apache Kafka API class that sends records to and receives records from Kafka topics.

How it is used
Provides an injected Spring client for publishing application domain objects asynchronously to Kafka topics.
How deep it goes
Explains dependency setup, broker configuration, typed send signatures, optional record fields, and a service implementation.
Examples
Uses a TacoOrder service, the tacocloud.orders.topic topic, localhost:9092, and a sendDefault variant.
What you can do after
Apply it via Spring Kafka by injecting a typed template and sending domain objects to named or configured default topics.

Read how Spring in Action, Sixth Edition explains KafkaTemplate →

Related concepts

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.