-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Wrong comparison of server bootstrap addresses in KafkaTemplate.afterSingletonsInstantiated #3466
Comments
@bleipold1 Thanks for the report. We will look into this soon. |
@bleipold1 While it looks like an issue, we are curious how you encountered this issue. If they don't match (even by type), then we get into the conditional for creating a new Also, this only happens if you have a Boot application because you always get the bootstrap server config from Boot as a In summary, this doesn't look like a bug, but an optimization on |
Fixes: spring-projects#3466 spring-projects#3466 Improve bootstrap-server config comparison to avoid unnecessary KafkaAdmin recreation. This addresses inconsistencies between List<String> and String configurations for bootstrap servers. The change ensures that List versions of bootstrap-server configs are converted to regular Strings by removing brackets. This allows for consistent comparison between producer and admin configurations. This optimization is particularly relevant for Spring Boot scenarios where configs may be provided in different formats but represent the same underlying values.
Fixes: spring-projects#3466 spring-projects#3466 Improve bootstrap-server config comparison to avoid unnecessary KafkaAdmin recreation. This addresses inconsistencies between List<String> and String configurations for bootstrap servers. The change ensures that List versions of bootstrap-server configs are converted to regular Strings by removing brackets. This allows for consistent comparison between producer and admin configurations. This optimization is particularly relevant for Spring Boot scenarios where configs may be provided in different formats but represent the same underlying values.
Fixes: spring-projects#3466 spring-projects#3466 Improve bootstrap-server config comparison to avoid unnecessary KafkaAdmin recreation. This addresses inconsistencies between List<String> and String configurations for bootstrap servers. The change ensures that List versions of bootstrap-server configs are converted to regular Strings by removing brackets. This allows for consistent comparison between producer and admin configurations. This optimization is particularly relevant for Spring Boot scenarios where configs may be provided in different formats but represent the same underlying values.
* GH-3466: Optimize KafkaAdmin creation in KafkaTemplate Fixes: #3466 #3466 Improve bootstrap-server config comparison to avoid unnecessary KafkaAdmin recreation. This addresses inconsistencies between List<String> and String configurations for bootstrap servers. The change ensures that List versions of bootstrap-server configs are converted to regular Strings by removing brackets. This allows for consistent comparison between producer and admin configurations. This optimization is particularly relevant for Spring Boot scenarios where configs may be provided in different formats but represent the same underlying values. * Addressing PR review (cherry picked from commit 1d4f7f9)
* GH-3466: Optimize KafkaAdmin creation in KafkaTemplate Fixes: #3466 #3466 Improve bootstrap-server config comparison to avoid unnecessary KafkaAdmin recreation. This addresses inconsistencies between List<String> and String configurations for bootstrap servers. The change ensures that List versions of bootstrap-server configs are converted to regular Strings by removing brackets. This allows for consistent comparison between producer and admin configurations. This optimization is particularly relevant for Spring Boot scenarios where configs may be provided in different formats but represent the same underlying values. * Addressing PR review (cherry picked from commit 1d4f7f9)
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.2.3
Describe the bug
In line 490 of KafkaTemplate are the bootstrap server addresses of the producer factory and the bootstrap server addresses of the kafka admin bean compared with each other. In most cases this will fail, because producerServers is a list of strings and adminServers always string. Even if the string represents the same list.
To Reproduce
Expected behavior
If producerServers and adminServers represent the same bootstrap servers, the if branch should not be entered.
The text was updated successfully, but these errors were encountered: