KStream.print() displays records flowing through a Kafka Streams topology, typically at the console. It is especially useful during development because feedback comes directly from the application rather than an external console consumer. section 6.5
print is a terminal operation: it returns void, ends the KStream chain, and cannot be followed by another stream transformation. Use it after a transformation when you want to inspect results; use peek when printing must occur between operators. section 6.5 section 6.7
Inspecting transformed records
KStream<String, String> upperCasedStream = simpleFirstStream.mapValues(value -> value.toUpperCase()); upperCasedStream.print(Printed.toSysOut()); upperCasedStream.to("out-topic", Produced.with(stringSerde, stringSerde)); The stream is printed after uppercasing, then separately written to Kafka. Printing does not replace the output-topic operation; it provides visual feedback while the topology runs. section 6.5
Printing KStream and KTable results
A KStream prints each stock-ticker record, while a KTable must first be converted with toStream(). With duplicate keys, the KStream shows all nine records in the example, whereas the KTable shows three update results. section 8.1.2




