Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Topic( s) [xxx] is/are not present and missingTopicsFatal is true

I'm receiving the following exception when trying to integrate kafka with spring boot:

java.lang.IllegalStateException: Topic(s) [pushEvent] is/are not present and missingTopicsFatal is true

Based on this thread I've tried to set the the spring.kafka.listener.missing-topics-fatal property to false. Because I have an jHipster app I added the following configuration into my application.yml:

spring:
  kafka:
    listener:
      missing-topics-fatal: false

Somehow the above config didn't had an effect and I still receive the above exception.

Am I missing something in the yaml config? Do I need to do something additional?

like image 530
florin Avatar asked Oct 16 '25 15:10

florin


1 Answers

It seems topic you are trying to produce message is not created. You can solve this problem with one of the following options:

  • Creating topic manually:

    bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

  • Enabling auto topic creation with setting auto.create.topics.enable to true in broker configs. (config/server.properties file in broker side)

auto.create.topics.enable: Enable auto creation of topic on the server

like image 74
H.Ç.T Avatar answered Oct 18 '25 08:10

H.Ç.T