spring-kafka AckMode中的MANUAL和MANUAL_IMMEDIATE有什么区别 [英] What is the difference between MANUAL and MANUAL_IMMEDIATE in spring-kafka AckMode

查看:1111
本文介绍了spring-kafka AckMode中的MANUAL和MANUAL_IMMEDIATE有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从spring-docs中,我可以看到

From spring-docs, I can see

MANUAL -消息侦听器负责确认(Acknowledgment);然后,应用与BATCH相同的语义.

MANUAL - the message listener is responsible to acknowledge() the Acknowledgment; after which, the same semantics as BATCH are applied.

MANUAL_IMMEDIATE -侦听器调用Acknowledgment.acknowledge()方法时,立即提交偏移量.

MANUAL_IMMEDIATE - commit the offset immediately when the Acknowledgment.acknowledge() method is called by the listener.

但是,如果侦听器提交偏移量,则到底有什么区别. MANUAL模式

But what exactly is the difference if the listener is committing the offset. What additional steps are done for MANUAL mode

推荐答案

MANUAL-在处理完最后一次轮询的所有结果后,将队列排队并在一次操作中提交偏移量.

MANUAL - acks are queued and the offsets committed in one operation when all the results from the last poll have been processed.

MANUAL_IMMEDIATE-只要在侦听器线程上执行确认,就立即提交偏移(同步或异步).

MANUAL_IMMEDIATE - the offset is committed immediately (sync or async) as long as the ack is performed on the listener thread.

这篇关于spring-kafka AckMode中的MANUAL和MANUAL_IMMEDIATE有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆