KafkaBinderProperties does not override with the KafkaBinderConfigurationProperties
See original GitHub issuethe Kafka Streams Binder topic does not seem to take the overrides provided in application.yml (or application.properties)
I have added the property - (default port for Kafka is different)
spring.cloud.stream.kafka.streams.binder.brokers: localhost:29092
The KafkaBinderConfiguration seems to read from KafkaBinderConfigurationProperties by initializing a new new KafkaBinderConfigurationProperties() and does not read the binder properties in application.yml
@Configuration
@ConditionalOnMissingBean({Binder.class})
@Import({KafkaAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class, KafkaBinderHealthIndicatorConfiguration.class})
@EnableConfigurationProperties({KafkaExtendedBindingProperties.class})
public class KafkaBinderConfiguration {
@Autowired
private KafkaExtendedBindingProperties kafkaExtendedBindingProperties;
@Autowired
private ProducerListener producerListener;
@Autowired
private KafkaProperties kafkaProperties;
public KafkaBinderConfiguration() {
}
@Bean
KafkaBinderConfigurationProperties configurationProperties() {
return new KafkaBinderConfigurationProperties();
}
@Bean
KafkaTopicProvisioner provisioningProvider(KafkaBinderConfigurationProperties configurationProperties) {
return new KafkaTopicProvisioner(configurationProperties, this.kafkaProperties);
}
The KTableBinderConfiguration is doing the right thing with resolved KafkaBinderConfigurationProperties
public class KTableBinderConfiguration {
@Autowired
private KafkaProperties kafkaProperties;
@Autowired
private KafkaStreamsExtendedBindingProperties kafkaStreamsExtendedBindingProperties;
public KTableBinderConfiguration() {
}
@Bean
public KafkaTopicProvisioner provisioningProvider(KafkaBinderConfigurationProperties binderConfigurationProperties) {
return new KafkaTopicProvisioner(binderConfigurationProperties, this.kafkaProperties);
}
@Bean
public KTableBinder kTableBinder(KafkaStreamsBinderConfigurationProperties binderConfigurationProperties, KafkaTopicProvisioner kafkaTopicProvisioner, KafkaStreamsBindingInformationCatalogue KafkaStreamsBindingInformationCatalogue) {
KTableBinder kStreamBinder = new KTableBinder(binderConfigurationProperties, kafkaTopicProvisioner, KafkaStreamsBindingInformationCatalogue);
return kStreamBinder;
}
}
the workaround for the override is to use the Kafka Spring Boot properties.
spring.kafka.producer.bootstrap-servers: localhost:29092
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Spring Cloud Stream Kafka Binder Reference Guide
In the latter case, if the topics do not exist, the binder fails to start. ... If you override the kafka-clients jar to...
Read more >Design for remove warning logs of unknown configs for Kafka ...
To convert the merged properties to a String of JAAS patter, we can just override the toString method of Jaas . 4.1.3. Put...
Read more >Spring Cloud Stream Kafka Binder Configuration update at ...
At runtime, you can override the values set in application.properties . ... binders as one cannot/should not store passwords inside Git.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sobychacko - Yes we can close this. thanks for the quick closure on this.
Ah - thanks @garyrussell. @prashantulavapalli Can we close this issue then?