Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer group not reconsuming messages if message is not marked #2854

Open
AhmedNSidd opened this issue Apr 5, 2024 · 0 comments
Open

Consumer group not reconsuming messages if message is not marked #2854

AhmedNSidd opened this issue Apr 5, 2024 · 0 comments

Comments

@AhmedNSidd
Copy link

Description

Using a go test, I'm producing a message for a kafka consumer group I created. In this consumer group, I'm logging the kafka message, but I'm not doing session.MarkMessage or session.Commit on the message. I would expect that this would allow me to reconsume the message, and it would relog the message in the for loop, but it does not reconsume the message.

Example code for handler

func (cgh *ConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error {
	for message := range claim.Messages() {
		log.Printf("Message claimed: value = %s, timestamp = %v, topic = %s", string(message.Value), message.Timestamp, message.Topic)
		//session.MarkMessage(message, "")
		//session.Commit()
	}
	return nil
}
Versions
Sarama Kafka Go
v1.43.0 3.6 1.21
Configuration
	saramaConfig.Consumer.Return.Errors = true
	saramaConfig.Consumer.Offsets.AutoCommit.Enable = false
Logs
logs: CLICK ME


Additional Context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant