Spring Kafka使用者,在运行时寻求偏移量? [英] Spring kafka consumer, seek offset at runtime?
本文介绍了Spring Kafka使用者,在运行时寻求偏移量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是Kafka主题中的KafkaMessageListenerContainer,我有一个应用程序逻辑来处理每条记录,这些记录也依赖于其他微服务.我现在在处理每条记录后手动提交偏移量.
I am using the KafkaMessageListenerContainer for consuming from the kafka topic, I have an application logic to process each record which is dependent on other micro services as well. I am now manually committing the offset after each record is processed.
但是,如果我的应用程序逻辑失败,则需要寻找失败的偏移量并继续对其进行处理,直到成功为止.为此,我需要对最后一个偏移量进行运行时手动搜索.
But if I the application logic fails I need to seek to the failed offset and keep processing it until it's succeeds. For that I need to do a run time manual seek of the last offset.
使用KafkaMessageListenerContainer还可以吗?
Is this possible with the KafkaMessageListenerContainer yet ?
推荐答案
查看全文