gabriel119435
gabriel119435

Reputation: 6792

How to configure Kafka to repeat uncommitted offset messages?

Suppose I have these messages on my topic:

[A, A, B, A, B]

A is processed successfully by my application, but B throws an unexpected exception. I thought changing ackOnError to false would not commit offset and thus the listener would repeat processing the same message until Kafka listener process the message without exceptions. I have set enable.auto.commit and ackOnError to false but the listener is still jumping to next message, doesn't matter if message is A or B.

How can I accomplish this desired behavior to keep my listener trying to process same message until it succeeds without exceptions?

Upvotes: 0

Views: 1011

Answers (1)

Gary Russell
Gary Russell

Reputation: 174494

You need to configure the SeekToCurrentErrorHandler to replay failures.

See the documentation.

Upvotes: 1

Related Questions