The same topic read as a table keeps only the latest value per key.
StreamsBuilder builder = new StreamsBuilder();
KStream<String, Order> orders = builder.stream("orders");
KTable<String, Customer> customers = builder.table("customers");
orders.join(customers, (order, customer) -> enrich(order, customer))
.to("orders-enriched");
KStream: every event, including three updates to the same key
KTable: one row per key, updated in place
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-11