[英]How to reset the offset value to re-read the kafka topic
There is a situation when Consumer1 reads messages from a kafka topic.有一种情况, Consumer1从 kafka 主题读取消息。 When connecting the second Consumer2 with the same groupId , there is a rebalance of partitions.
当使用相同的groupId连接第二个Consumer2时,会重新平衡分区。 Is it possible to somehow reset the offset , so that after the rebalance process, both Consumers read the topic from the beginning?
是否有可能以某种方式重置offset ,以便在重新平衡过程之后,两个消费者都从头开始阅读主题?
I think as per your requirement you can set the offset value as Earliest , so that it can consumed from beginning.我认为根据您的要求,您可以将偏移值设置为Earliest ,以便它可以从一开始就消耗掉。
For more details for offset you can visit this article which explains what value you can set offset value to [https://dzone.com/articles/apache-kafka-consumer-group-offset-retention]有关偏移的更多详细信息,您可以访问这篇文章,该文章解释了您可以将偏移值设置为[https://dzone.com/articles/apache-kafka-consumer-group-offset-retention] 的值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.