How to configure Kafka to repeat uncommitted offset messages?

不羁岁月 提交于 2019-12-24 18:35:05

问题


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?


回答1:


You need to configure the SeekToCurrentErrorHandler to replay failures.

See the documentation.



来源:https://stackoverflow.com/questions/57293709/how-to-configure-kafka-to-repeat-uncommitted-offset-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!