shiva.n404
shiva.n404

Reputation: 478

Kafka consumer side failure handling and redelivery

What happens if some of the messages not Ack'ed back in kafka. Lets say I am consuming messages concurrently. And one consumer not able to process the message with offset=20 and didn't send Ack back. But other message with offset=21 been consumed and ack back. How can I replay only 20?

Do I need to put message to DLQ and consume again? what if failure happens there also?

I am little confused with guaranteed delivery.

Upvotes: 3

Views: 2222

Answers (2)

FeeLGooD
FeeLGooD

Reputation: 505

In you case, your latest committed offset is 21. and Kafka assume your 20 also committed. So when you restart it will start from offset 21. Yes. I remember Gary mention that you either need to stop the container at 20 or put the 20 to some other topic for later reply.

Upvotes: 0

Gary Russell
Gary Russell

Reputation: 174504

If you use group management, where kafka assigns the partitions, it can't happen - a partition is assigned to one thread only. If you have more threads, they are each consuming from a different partition which each have their own offset.

Upvotes: 5

Related Questions