liveBook · Manning

Produced

As explained in Kafka Streams in Action, Second Edition

Produced is a Kafka Streams configuration object that specifies output serializers and deserializers and other settings for a sink node.

Produced is a Kafka Streams configuration object for a sink node. It supplies output Serde instances and can also configure optional settings such as a custom StreamPartitioner. section 6.3.1

Writing transformed records

After converting values to uppercase, write them to a Kafka topic with explicit key and value Serdes: upperCasedStream.to("out-topic", Produced.with(Serdes.String(), Serdes.String())); Kafka Streams uses configured defaults when explicit Serdes are omitted. section 6.3.1

Listing 6.5 Creating a sink node
upperCasedStream.to("out-topic",
               Produced.with(Serdes.String(), Serdes.String()));

Inspect the complete sink-node example for the Yelling application. section 6.3.1

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains sink-node construction, explicit or default Serdes, key/value-specific configuration, and custom partitioning.
Examples
Uses the Yelling application to write uppercase stream values to out-topic.
What it assumes
Builds on a KStream that already consumes records and transforms values.
What you can do after
Build a Kafka Streams sink with Produced.with and explicit key and value Serdes.
How it connects
Connects KStream, Kafka topics, Serdes, sink nodes, and StreamPartitioner.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.