How to set acknowledgement in case when retry gets exhausted in Kafka consumer

余生颓废 提交于 2019-12-06 16:01:46

If you have a RecoveryCallback that handles the record when retries are exhausted, and you are NOT using manual acks, the container will commit the offset.

If you are using MANUAL acks, you can commit the offset in the recovery callback.

The context object passed to the callback has an attribute RetryingMessageListenerAdapter.CONTEXT_ACKNOWLEDGMENT ('acknowledgment').

It also has CONTEXT_CONSUMER and CONTEXT_RECORD.

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