简体   繁体   中英

Kafka Streams Global Store - Adding change log topic

I have a situation where i want to maintain my own global table structure. Essentially, Global Store is linked to a processor and i use some calculations to create key and then store it to key-value store.

Since global state store doesn't have change log topic, it uses original topic as change log. And in case of state restore, it just loads the topic data to global table (which will be wrong) since we constructed our own key & value.

Topic Data

Key, value
1234,abcd
4567,defg

StateStore
Key, value
12ab, abcd
45de, defg

My requirement is to create a global store with my custom keys ( not the one which comes directly from topic). Any solution ?

The following link answers my question Kafka streams use cases for add global store

This is currently not supported until https://issues.apache.org/jira/browse/KAFKA-7663 and https://issues.apache.org/jira/browse/KAFKA-8037 are resolved.

Currently, a global Processor cannot change the data without breaking the application. You can only put unmodified data into the global state store.

As a workaround, you could do a preprocessing step that modifies the data, writes it back into a topic, and you consume this topic into your global state store.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM