-
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
kafkaAdmin auto configuration when creating KafkaTemplate #2780
Comments
@ChangguHan This is a reasonable request, but the work around is to set an admin instance yourself... spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/core/KafkaTemplate.java Lines 465 to 472 in 156d096
|
@garyrussell I understood your point. spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/core/KafkaTemplate.java Lines 485 to 491 in 701ed82
|
This comment was marked as outdated.
This comment was marked as outdated.
I think I have an issue kinda related to this request. When I want to publish events in parallel and Kafka Admin is not initialized yet, I see several Kafka admin creations/initializations in the logs, and my publishing just stops. As a result, no events are published, and the producing process gets stuck. I mean something like this:
creation of Kafka Admin beforehand and setting it for the template solves the issue. but I wondering if this is the correct behavior |
that is not possible if your
And this |
Hi @artembilan. Thanks for the quick response. Unfortunately, I'm able to reproduce it without any custom bean scopes or manual bean creation. Created a small project, so you could try it by yourself - Reproduce example Could you please check? Thanks in advance. |
But that's correct, because
So, it is not a surprise to see several instances of the Not sure, though why there has to be many of them since
The I'll run your application after lunch. |
can you update your sample project, please, with build tool ? |
yeap, sorry. added |
I see what is going on. Probably not related to this issue, but still looks like a bug 🤷 |
See the fix: #2944 |
@artembilan nice, thanks a lot! |
Expected Behavior
When using multiple kafkaTemplates with observations, the kafkaAdmin made automatically can connect to kafka with SSL.
Current Behavior
When using multiple kafkaTemplates with observations, the properties for sasl, security, ssl is not applied to the kafkaAdmin.
It could be the problem when I set
bootstrap.servers
with the port for ssl.Context
I would like to suggest two things.
Then we could simplify the kafkaAdmin creation logic by making a new kafkaAdmin with producerFactory's config when kakfAdmin is null.
The sample code would be like this.
The text was updated successfully, but these errors were encountered: