KIP-622 — Add currentSystemTimeMs and currentStreamTimeMs to ProcessorContext
Accepted Kafka 3.0 StreamsTesting
Exposes `currentSystemTimeMs()` and `currentStreamTimeMs()` methods on `ProcessorContext` in Kafka Streams, sourcing the timestamps from the Streams runtime rather than `System.currentTimeMillis()`. This makes wall-clock and stream-time usage testable because `MockTime` can control both values during unit tests.
Details
| Author | William Bottrell |
| Status | Accepted |
| Kafka Version | 3.0 |
| JIRA | KAFKA-10062 |
| Wiki | View on Apache Wiki |
| Created | 2020-06-09 |
| Last Modified | 2022-04-14 |
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.