KTable.suppress buffers updates from a windowed aggregation so downstream consumers receive a single result when the window closes instead of intermediate results. section 9.3
Use suppression after the aggregation:
- Call .suppress(Suppressed.untilWindowCloses(StrictBufferConfig.unbounded())). section 9.3
- Choose strict buffering when no result should be emitted before the window closes. section 9.3
- Apply the same pattern to session-window aggregations before converting the KTable to a stream. section 9.3
Session-window aggregation
pageViewStream.groupByKey()\n .windowedBy(SessionWindow.ofInactivityGapWithNoGrace(Duration.ofMinutes(2)))\n .aggregate(HashMap::new, sessionAggregator, sessionMerger)\n .suppress(Suppressed.untilWindowCloses(unbounded()))\n .toStream() section 9.3
Figure 9.30 Strict buffering retains all results and never emits one before a window closes.
Shows how strict buffering retains all results and prevents emission before a window closes. section 9.3
