2
votes

I am new at Kafka. I am trying to create a random topic name at run time. My producer create a random string like MQ* and it uses that string as topic and send to message that topic. Consumer side know that random topic and subscribe it. But consumer couldn't poll records. I am getting below error producer or consumer side.

WARN 10816 --- [nio-8087-exec-1] org.apache.kafka.clients.NetworkClient   : Error while fetching metadata with correlation id 1 : {MQ654498631=LEADER_NOT_AVAILABLE}

Anyway to achieve this?

1
Do your brokers allow to create topics automatically? Check broker config's option auto.create.topics.enable. It should be true - Yuri Tceretian

1 Answers

0
votes

Set auto.create.topics.enable to true in the broker's config.