I have a configuration bean
@Bean("alertsTopic")
public NewTopic alertsTopic() {
return TopicBuilder.name(PORTAL_ALERTS)
.config(TopicConfig.DELETE_RETENTION_MS_CONFIG, String.valueOf(Duration.ofHours(1).getSeconds() * 1000))
.compact()
.build();
}
However, when I check
./kafka-configs.sh --bootstrap-server kafka:9092 --describe --topic portal.alerts --all
It appears that none of my settings are set.
I am presuming that I may have inadvertently created the topic before I put in the configuration. My question is how do I make my application detect that the value of NewTopic
matches the configuration that is present otherwise terminate the application context.
Or force it to update.