After upgraded to spring boot 3.1.0 configuration of kafka server via configuration property spring.kafka.properties.bootstrap.servers no longer working.
Always using default value localhost:9092 and therefore unable to connect.
Workaround to make it work is using configuration property spring.kafka.bootstrapServers but I don't think this is the intended way for configuration.
Comment From: wilkinsona
Workaround to make it work is using configuration property spring.kafka.bootstrapServers but I don't think this is the intended way for configuration.
This is the intended way.
kafka server via configuration property
spring.kafka.properties.bootstrap.serversno longer working
spring.kafka.properties.* configuration is for "Additional properties, common to producers and consumers, used to configure the client". In other words, it's for configuring Kafka settings for which Spring Boot does not have a specific property.
That said, even if it wasn't intended, this worked in previous versions. We should consider if we want to reinstate that behavior to make upgrades easier. It would require PropertiesKafkaConnectionDetails to consider entries in the spring.kafka.properties map.
Comment From: robtha
@wilkinsona thanks for clarifying
Comment From: wilkinsona
We've decided not to reinstate the previous behaviour as it wasn't intentional. We're going to tighten things up and fail-fast if one of Boot's properties is configured in the spring.kafka.properties map of additional properties.
Comment From: stillya
@wilkinsona Hello, I've created PR to close this issue. Could you take a look when you get a chance?