EmitStrategy.onWindowClose() configures a Kafka Streams windowed aggregation to release its result only when the window closes. Add it after windowedBy(...) and before aggregate(...). section 9.3
One-minute tumbling window
iotHeatSensorStream.groupByKey()\n .windowedBy(TimeWindows.ofSizeWithNoGrace(\n Duration.ofMinutes(1)))\n .emitStrategy(EmitStrategy.onWindowClose())\n .aggregate(...);\n\nThis prevents intermediate aggregation results from being emitted while the window remains open. EmitStrategy.onWindowUpdate() is the default when no policy is specified. section 9.3
Figure 9.29 Only a single result is emitted when a window closes.
Shows the output distinction: a closing window produces one final result instead of intermediate results. section 9.3
