spring-kafka AckMode中MANUAL和MANUAL_IMMEDIATE有什么区别 [英] What is the difference between MANUAL and MANUAL_IMMEDIATE in spring-kafka AckMode
问题描述
从 spring-docs,我可以看到
From spring-docs, I can see
MANUAL - 消息侦听器负责确认()确认;之后,应用与 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 - 只要在侦听器线程上执行 ack,就会立即提交偏移量(同步或异步).
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屋!