A sliding window bounds a stream join by the difference between event timestamps. It lets related records wait for one another without requiring simultaneous arrival. section 8.3.6
Use sliding windows when asynchronous events must still be matched:
- Keep each event in a state store until its matching event arrives or the window expires. section 8.3.6
- Match records when their timestamp difference is less than the configured interval; discard unmatched records after expiry. section 8.3.6
- Key the participating streams consistently and satisfy copartitioning requirements so matching records are processed together. section 8.3.6
Orders and payments
An order and its payment may arrive at different times. With a one-day sliding window, Kafka Streams retains each event and joins the pair when their timestamps differ by less than one day; otherwise, the unmatched event is discarded. section 8.3.6
Figure 8.14 When the Payments and Orders topics are joined, they must have the same number of input partitions and the same key (orderId).
Use the partition diagram to verify that joined topics share the same key and partition count, allowing corresponding records to reach the same task. section 8.3.6




