0

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.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

1 Answers1

0

The only modifications the KafkaAdmin will make, if a topic already exists, is increase the number of partitions.

For other changes you must use an AdminClient yourself.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179