Hi Matthias, >From my understanding (please correct me if i am wrong): KV/Window Stores: Use ValueTimestampHeaders<V> because they store individual records that always require a timestamp.
Session Stores: Use AggregationWithHeaders<AGG> because the AGG result is generic (e.g., Long, String, or POJO), and session boundaries are managed by the store rather than the value wrapper. Additionally, during session merges, the application logic must decide which headers to persist. This wrapper provides a clean way to store that custom-processed metadata. The downside is that the user must explicitly handle how to merge headers. I am also wondering if we could just use ValueTimestampHeaders directly to simplify the API? Best, TengYao On 2026/01/12 18:44:54 Alieh Saeedi via dev wrote: > Hey Chia-Ping, > > Thanks for the feedback. > > chia_0: the headers must be serialized as a byte array. I updated the KIP > about that. > chia_1: this is the reason different store types are introduced. The newly > introduced stores keep the headers, while the current ones not. > chia_2: that’s a valid point. I think it’s better to keep the order rather > than change it. > > > Bests, > Alieh > > On Sat, Jan 10, 2026 at 2:21 AM Chia-Ping Tsai <[email protected]> wrote: > > > hi Alieh > > > > Thanks for the KIP. This proposal seems to open the door for many > > interesting use cases. I have a few questions? > > > > chia_0: could you clarify the serialization format of headers_bytes? > > > > chia_1: how does the state store distinguish between legacy values and > > new values with headers? Since the new format starts with a 2-bytes length, > > is there a risk of ambiguity with existing data? > > > > chia_2: does the implementation guarantee that the order of headers is > > preserved > > > > Best, > > Chia-Ping > > > > > > > > > Alieh Saeedi via dev <[email protected]> 於 2026年1月10日 清晨6:14 寫道: > > > > > > Hi all, > > > > > > I’d like to start a discussion on KIP-1271, which proposes allowing Kafka > > > Streams state stores to preserve record headers. > > > This would let header-based metadata like schema IDs, tracing info, and > > > feature flags be stored and restored alongside values. > > > The KIP introduces header-aware store types and a small config to cap the > > > size of headers written into state. > > > Details are in the KIP: > > > > > https://cwiki.apache.org/confluence/display/KAFKA/KIP-1271%3A+Allow+to+Store+Record+Headers+in+State+Stores > > > . > > > I’d appreciate your feedback and questions on the proposal. > > > > > > Thanks, > > > Alieh > > >
