A lookup retrieves the value associated with a message key from stored state. In stream processing, it replaces an impossible cross-table operation over infinite streams: process one message, find its corresponding table entry, and use both values for a join or enrichment. section 12.4.3
Enriching sales with product data
Treat compacted product master data as a table keyed by product ID. For each keyed sales message, look up the current product record and add its manufacturer before producing enriched sales data. The same pattern joins loyalty cards with customers. 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
The topology creates a sales stream and product table, then passes the stream value and looked-up table value to a joiner. section 12.4.3

