0
votes

I am using Spring boot 1.5.9.RELEASE and Spring cloud Edgware.RELEASE across the Microservices.

I've bound a consumer using @EnableBinding annotation. The annotation will do rest of the part for me to consume events.

Some requirements came up to configure the topic name and some other configuration properties manually for which I want to override some of the properties of a consumer defined in an application.properties at application boot time.

Is there any direct way to do such?

1
Could you please clarify a bit? Are you trying to re-configure something that has already been configured using property mechanism?Oleg Zhurakousky
I have a Microservice M1 and at the startup of M1, I am fetching Kafka topic name from another Microservice M2. Thereafter I need to use this topic to consume events.Mahesh Pardeshi

1 Answers

0
votes

You can use an initialization bean, it can do the work:

@SpringBootApplication
public class SpringDataDemoApplication {

    @Bean
    InitializingBean populateDatabase() {
        return () -> {
            // doWhatYouWantHere...
        };
}