1) generateFromSleepingBackOffPolicy method in org.springframework.kafka.retrytopic.BackOffValuesGenerator
I have removed the code to set the `maxBackOffPeriod`, if the BackOffPolicy is `UniformRandomBackOffPolicy`. This is not required since, when sleeper is added to the `UniformRandomBackOffPolicy` `maxBackOffPeriod` is not modified. This could be an issue with the earlier versions of spring-retry. But, latest version of spring-kafka 3.3 and spring-retry 2.0.8, this is not an issue.
2) Modify addIfAbsent in org.springframework.kafka.retrytopic.ListenerContainerFactoryResolver.Cache to use putIfAbsent, rather than explictly checking for the key, if it is not there than adding it to the HashMap.
Following code could be considered to refactor.
1)
generateFromSleepingBackOffPolicy
method inorg.springframework.kafka.retrytopic.BackOffValuesGenerator
2) Modify
addIfAbsent
inorg.springframework.kafka.retrytopic.ListenerContainerFactoryResolver.Cache
to useputIfAbsent
, rather than explictly checking for the key, if it is not there than adding it to the HashMap.Please give your comments.