Back Off Delay Precision

Overview and Guarantees

所有消息处理和退避由使用者线程处理,因此以尽力为基础保证延迟精度。如果一条消息的处理时间超过该使用者下一条消息的退避期,则下一条消息的延迟将高于预期。此外,对于较短的延迟(大约 1 秒或更短),线程必须执行的维护工作(比如提交偏移量)可能会延迟消息处理执行。如果重试主题的使用者处理多个分区,精度也可能受到影响,因为我们依靠从轮询唤醒使用者并拥有完整的轮询超时来进行时间调整。

All message processing and backing off is handled by the consumer thread, and, as such, delay precision is guaranteed on a best-effort basis. If one message’s processing takes longer than the next message’s back off period for that consumer, the next message’s delay will be higher than expected. Also, for short delays (about 1s or less), the maintenance work the thread has to do, such as committing offsets, may delay the message processing execution. The precision can also be affected if the retry topic’s consumer is handling more than one partition, because we rely on waking up the consumer from polling and having full pollTimeouts to make timing adjustments.

话虽如此,对于处理单个分区的使用者,在大多数情况下,消息的处理应大约在其确切到期时间发生。

That being said, for consumers handling a single partition the message’s processing should occur approximately at its exact due time for most situations.

可以保证消息绝不会在到期之前进行处理。

It is guaranteed that a message will never be processed before its due time.