-
Hello, I want to share some ideas and implementations I made here for the non-blocking retries. This is not a feature request, is just idea sharing. When making retries, I think it is essential to pursue two things:
At first, exponential backoff seems to fit this requirement. However, to achieve the second requirement above, a large number of retry topics are needed. In a way that makes this impractical. Fixed backoff allows a single retry topic to be used, but adopting fixed backoff brings the problem of inefficiency: in order to have quick retries and insist for a long time, one has to configure an excessive amount of attempts (with an interval of 5s, to keep trying for 4 hours, you need to configure 2880 maxAttempts, which is too much, besides too much CO2). So I conceived here a custom
For example: phases:
- duration: PT3M
interval-between-retries: PT5S
- duration: PT30M
interval-between-retries: PT45S
- duration: PT6H
interval-between-retries: PT2M For 3 minutes, make retries each 5 seconds, for 30 minutes, make retries each 45 seconds, for 6 hours, make retries every 2 minutes. The amount of retry topics needed is the amount of phases. For this to work, only the backoff policy was not enough. I had to make an extension of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Another possibility would be for the spring-kafka to have an option to have a single retry topic, for the For instance, for exponential with
but for 8000-0 and above, it might actually be just one:
this would make it easier to adopt exponential when retrying for a long time. |
Beta Was this translation helpful? Give feedback.
Another possibility would be for the spring-kafka to have an option to have a single retry topic, for the
maxInterval
when using exponential backoff.For instance, for exponential with
initialInterval=1000
,multiplier=2
,maxInterval=8000
, andmaxAttempts
=a large number, you would have retry topics like these:but for 8000-0 and above, it might actually be just one:
this would make it easier to adopt exponential when retrying for a long time.