Kafka Streams: How to use persistentKeyValueStore to reload existing messages from disk?

后端 未结 2 1530
难免孤独
难免孤独 2021-01-16 09:58

My code is currently using an InMemoryKeyValueStore, which avoids any persistence to disk or to kafka. I want to use rocksdb (Stores.persistentKeyValueStore) so that the ap

相关标签:
2条回答
  • 2021-01-16 10:27

    You use a persistent store the exact some way as an in-memory store. The store takes care of the rest and you don't need to worry about loading data etc. You just use it.

    0 讨论(0)
  • 2021-01-16 10:46

    How do I register it with the streams builder?

    By calling StreamsBuilder#addStateStore().

    https://kafka.apache.org/22/javadoc/org/apache/kafka/streams/StreamsBuilder.html#addStateStore-org.apache.kafka.streams.state.StoreBuilder-

    See StateStoresInTheDSLIntegrationTest at https://github.com/confluentinc/kafka-streams-examples fro an end-to-end demo application.

    0 讨论(0)
提交回复
热议问题