Description
Expected Behavior
If spring.application.name
is defined, it should be used as default Kafka clientId unless overriden by more specific configs. I get the behaviour that I think would be a good default by defining this in my application:
spring.kafka.client-id=${spring.application.name}
Current Behavior
The default clientIds are "producer", "adminclient", etc.
Context
We operate fairly large shared Kafka clusters and a couple of important metrics and log output by Kafka only includes the clientId and not the username. Especially for producers this means we see many of our customers implicitly connecting using "producer-1" as clientId as there is no way on Kafka server side to enforce a specific pattern. By using a more specific default this would ease problem analysis on server side. spring.application.name
would be an ideal default because this is also used for similar use cases with other technologies.
I could have a look at creating a pull request for this, if this isn't something that has already been rejected in the past.