gpt4 book ai didi

apache-storm - Kafka Storm spout 改变拓扑并从旧偏移量中消费

转载 作者:行者123 更新时间:2023-12-01 02:21:02 25 4
gpt4 key购买 nike

我正在使用 kafka spout 来消费消息。但是,如果我必须更改拓扑并上传,那么它会从旧消息恢复还是从新消息开始? Kafka spout 让我们可以指定从哪里消费的时间戳,但我怎么知道时间戳?

最佳答案

spoutConfig.forceStartOffsetTime(-1);

It will choose the latest offset written around that timestamp to start consuming. You can force the spout to always start from the latest offset by passing in -1, and you can force it to start from the earliest offset by passing in -2.



references

关于apache-storm - Kafka Storm spout 改变拓扑并从旧偏移量中消费,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20467916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com