Can I get an example of creating a topic using segmentio's kafka-go?
I have tried creating a topic as below:
c, _ := kafka.Dial("tcp", "host:port")
kt := kafka.TopicConfig{Topic: "sometopic", NumPartitions: 1, ReplicationFactor: 1}
e := c.CreateTopics(kt)
But this will work only if the given host:port is Kafka Leader. If the host:port is not Kafka Leader, then I will be getting this error:
Not Controller: this is not the correct controller for this cluster*
What is the right way of passing clusters address for creating a topic?
Kafka Segmentio: github.com/segmentio/kafka-go