In the Kafka Streams API, operations are classified as stateless or stateful based on whether they require maintaining local state stores. According to the official Kafka Streams documentation, stateless operations process each record independently, without storing or accessing prior records.
Filter is a stateless operation because it evaluates each record individually and decides whether to pass it downstream. It does not require any state or historical context.
GroupBy is also considered stateless because it merely repartitions the stream by assigning a new key and forwarding records to downstream processors. While it triggers the creation of an internal repartition topic, the GroupBy operation itself does not maintain a state store.
In contrast, Reduce is a stateful operation because it aggregates records over time and requires maintaining intermediate results in a state store. Similarly, Join operations are stateful because Kafka Streams must buffer and store records from one or both input streams or tables to perform the join within a defined time window.
Thus, the correct stateless operations are Filter and GroupBy, as documented in the Kafka Streams developer guide.
Submit