Eager buffering bounds suppression storage by record count or byte size, allowing Kafka Streams to emit intermediate windowed results before the window closes. section 9.3
Use eager buffering when bounded memory matters more than guaranteeing one final result:
- Configure a time limit for waiting on a new record; a new record replaces the existing buffered result without resetting the timer. section 9.3.2
- Configure a maximum record count or byte size; when the buffer fills, suppression forwards a result immediately. section 9.3 section 9.3.2
- Expect possible intermediate or duplicate results rather than the strict strategy’s single final result. section 9.3
Kafka Streams configuration
Apply eager buffering with a one-minute time limit and a 1,000-record maximum: .suppress(untilTimeLimit(Duration.ofMinutes(1), maxRecords(1000).emitEarlyWhenFull())). Matching the time limit to the window size plus any grace period may produce a final result when the window closes, but a full buffer can still emit earlier. section 9.3.2
Listing 9.26 Using suppression with eager buffering
.suppress(untilTimeLimit(Duration.ofMinutes(1), #1
maxRecords(1000) #2
.emitEarlyWhenFull())) #3
Inspect the Java suppression configuration for combining a time limit, record bound, and early emission. section 9.3.2
