[英]Kafka Consumer configuration - How does auto.offset.reset controls the message consumption
I'm trying to understand, how does the ConsumerConfig.auto.offset.reset = latest would affect the message consumption.我试图了解 ConsumerConfig.auto.offset.reset = latest 将如何影响消息消费。
For example I've a consumer, sending 100 messages initially at time t1 and then my consumer is up and running at t1+30 sec, then would my consumer consume the messages published after t1+30 sec or will it consume messages published t1 onwards?例如,我有一个消费者,最初在时间 t1 发送 100 条消息,然后我的消费者在 t1+30 秒启动并运行,然后我的消费者将使用在 t1+30 秒之后发布的消息还是会使用从 t1 开始发布的消息?
It depends.这取决于。
auto.offset.reset
only applies when there is no stored offset for the consumer group. auto.offset.reset
仅适用于没有为消费者组存储偏移量的情况。
It applies to the following conditions:它适用于以下条件:
If a consumer commits an offset;如果消费者提交了偏移量; it will start at the last committed offset the next time it is started.
它将在下次启动时从最后提交的偏移量开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.