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

后端 未结 2 1543
难免孤独
难免孤独 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: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.

提交回复
热议问题