Closed bentcoder closed 1 month ago
This sort of looks like what I would expect if you had Config.Offsets.Initial == OffsetNewest
. When the consumer joins the topic, it would then be waiting for newer messages, and not from the start. Relevant comments on the field from godoc:
// The initial offset to use if no offset was previously committed.
// Should be OffsetNewest or OffsetOldest. Defaults to OffsetNewest.
Initial int64
I actually changed it to OffsetOldest
and it has been working fine since but I wasn't sure if this was, in fact, the solution. Hence I wanted to wait for a comment.
Great news. :) Good to get feedback that what the thing that first comes to mind was the issue. 👍
Yep, the described behaviour does match with what you'd expect a consumer to do if it starts as a new group without any committed offset(s) and a config setting of sarama.OffsetNewest
Excellent, thank you!
Description
Hi,
If I write in order, it would probably be clearer so here it is:
10000
ms at topic creation and run it. The consumer app is not running yet.So technically what's happening here is that, when messages are deleted from topic due to retention settings, consumer will not see new messages that were added after deleted messages. This happens if I run consumer after adding new messages. If I run it in the middle and send messages, it would consume them.
This issue doesn't exists if I don't set those two retention entries at
ConfigEntries
.Versions
Configuration
Producer app
Create topic.
Send message.
Consumer app