Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactoring #3476

Closed
LokeshAlamuri opened this issue Aug 31, 2024 · 1 comment
Closed

Code refactoring #3476

LokeshAlamuri opened this issue Aug 31, 2024 · 1 comment

Comments

@LokeshAlamuri
Copy link
Contributor

Following code could be considered to refactor.

  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.

Please give your comments.

@LokeshAlamuri
Copy link
Contributor Author

Please review the following PR and give your comments.

https://github.com/spring-projects/spring-kafka/pull/3477/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants