A stream-table join enriches each incoming stream record by looking up the value with the same key in a table. For example, sales data can be combined with the matching product record to add manufacturer information before the enriched event continues through the topology. section 12.4.3
The execution model has several practical consequences:
- New data on the stream triggers the lookup and join immediately for that record. section 12.4.3
- A table update does not join backward against earlier stream records; the updated value is used only when another stream record arrives. section 12.4.3
- Matching depends on compatible keys and co-partitioning: the inputs need the same key and the same number of partitions. section 12.4.3
- Use a table-table join when changes on either side must trigger execution; use a stream-stream join with time windows when both inputs are infinite streams. section 12.4.3 section 12.7
Enriching sales with product master data
Read salesData as a stream and products as a table. The join function receives a sale, looks up its product key, copies the product manufacturer into the sale, and emits the enriched record. A later product update changes future enrichments but does not reprocess existing sales automatically. section 12.4.3
KStream salesData = builder.stream("salesData"); #1
KTable masterData = builder.table("products"); #2
ValueJoiner enricher = (salesData, masterData) -> { #3
salesData.manufacturer = masterData.manufacturer;
return salesData;
};
KStream salesData_enriched = salesData.join(
masterData, enricher); #4
Inspect the Kafka Streams topology pattern: create a KStream for sales, create a KTable for products, define a ValueJoiner, and call join. section 12.4.3

