You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/retrytopic.adoc
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,27 @@ IMPORTANT: You can set the `AckMode` mode you prefer, but `RECORD` is suggested.
23
23
24
24
IMPORTANT: At this time this functionality doesn't support class level `@KafkaListener` annotations
25
25
26
+
=== Back Off Delay Precision
27
+
28
+
==== Overview and Guarantees
29
+
30
+
All message processing and backing off is handled by the consumer thread, and, as such, delay precision is guaranteed on a best-effort basis.
31
+
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.
32
+
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.
33
+
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.
34
+
35
+
That being said, for consumers handling a single partition the message's processing should happen under 100ms after it's exact due time for most situations.
36
+
37
+
IMPORTANT: It is guaranteed that a message will never be processed before its due time.
38
+
39
+
==== Tuning the Delay Precision
40
+
41
+
The message's processing delay precision relies on two `ContainerProperties`: `ContainerProperties.pollTimeout` and `ContainerProperties.idlePartitionEventInterval`.
42
+
Both properties will be automatically set in the retry topic and dlt's `ListenerContainerFactory` to one quarter of the smallest delay value for that topic, with a minimum value of 250ms and a maximum value of 5000ms.
43
+
These values will only be set if the property has its default values - if you change either value yourself your change will not be overridden.
44
+
This way you can tune the precision and performance for the retry topics if you need to.
45
+
46
+
NOTE: You can have separate `ListenerContainerFactory` instances for the main and retry topics - this way you can have different settings to better suit your needs, such as having a higher polling timeout setting for the main topics and a lower one for the retry topics.
0 commit comments