【发布时间】:2018-08-31 17:16:07
【问题描述】:
引用本文档的 4.2.6 https://docs.spring.io/spring-kafka/reference/htmlsingle/#kafka-streams
如何使用 kafka 流 spring 支持访问状态存储?
没有春天你能行吗?
StreamsBuilder builder = ...;
// Start an instance of the topology
KafkaStreams streams = new KafkaStreams(builder, config);
...
// Get the key-value store CountsKeyValueStore
ReadOnlyKeyValueStore<String, Long> keyValueStore =
streams.store("CountsKeyValueStore", QueryableStoreTypes.keyValueStore());
但我不确定如何访问 KafkaStreams 对象。
【问题讨论】:
标签: apache-kafka apache-kafka-streams spring-kafka