question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KafkaBinderProperties does not override with the KafkaBinderConfigurationProperties

See original GitHub issue

the 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:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
prashantulavapallicommented, May 21, 2018

@sobychacko - Yes we can close this. thanks for the quick closure on this.

0reactions
sobychackocommented, May 21, 2018

Ah - thanks @garyrussell. @prashantulavapalli Can we close this issue then?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found