当消息数量达到最大值 retention.bytes 时,kafka 将删除消息,偏移量将重置为零?

when the amount of messages reach the maxsize of retention.bytes ,the kafka will delete messages,the offset will be reset to zero?

我是kafka新手,在使用kafka时,我们可以设置retention.bytes。假设我们设置为 1GB,如果消息量达到 1GB,kafka 将删除 messages.I 想问一下偏移量是否会重置为零? 第二,consumer设置auto.offset.reset为最大,kafka删除消息后,consumer会启动多少offset?

对于您的问题 #1,在遵守 size-based 和 time-based 政策的情况下,日志可能会滚动到一个新的空日志段。新日志段文件的起始偏移量将是将附加到日志的下一条消息的偏移量。

对于您的问题 #2,视情况而定。如果消费者跟踪的偏移量由于消息删除而超出范围,那么它将被重置为最大的偏移量。