我正在使用Kafka流,并希望将一些消费者偏移从Java重置为开头。 KafkaConsumer.seekToBeginning(...)听起来是正确的事情,但我与Kafka Streams合作:
KafkaStreams streams = new KafkaStreams(builder, props); ... streams.start();我想这取决于具体的流管道我定义这将在引擎盖下创建几个消费者。 我可以访问这些吗? 或者是否有其他方法以编程方式重置偏移?
I am using Kafka streams and want to reset some consumer offset from Java to the beginning. KafkaConsumer.seekToBeginning(...) sounds like the right thing to do, but I work with Kafka Streams:
KafkaStreams streams = new KafkaStreams(builder, props); ... streams.start();I guess that depending on the concrete streams pipeline I define this would create several consumers under the hood. Can I get access to those? Or is there some other way to reset offsets programmatically?
最满意答案
由于您使用的是Kafka Streams,因此您不仅要重置消费者偏移,还要重置Streams内部状态存储。
幸运的是,Kafka提供了一个Streams应用程序重置工具。
请参阅https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Streams+Application+Reset+Tool
Since you are using Kafka Streams you will want to reset not only the consumer offsets but also the Streams internal state store.
Fortunately there is a Streams Application Reset Tool provided with Kafka.
See https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Streams+Application+Reset+Tool
更多推荐
发布评论