Custom retry delay duration from supplier function
astubbs opened this issue · comments
Most flexible, pluggable retry delay system - user provides a function that generates a retry delay.
@radoslawtwardy how does this look? : master...astubbs:retry-delay-generator-func
It's a simple change. The other option I'd been thinking about, would be for the user function to throw a "retry exception" which will contain the retry delay as a field. The motivation for that solution is it gives the user ultimate context to generate the retry delay. Where as the retry delay function option only gives the user the WorkContainer as context.
I'm not sure how can I use it. To write custom function i must has some retry count context, or something like it. For example i want write simple algorithm:
2^retryNb [s]
How i can use WorkContainer to do it? Maybe i can get some previous, effective delay from it ?
@radoslawtwardy there is now an example of this here: https://github.com/confluentinc/parallel-consumer#retry-delay-function