0

I want to know is there a way to set the broker ID for Kafka in Java?

I can see there is broker.id configuration parameter in server.properties to configure broker ID, but I want this to be overridden during run time by picking the broker ID from a configuration file from each broker node.

Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
  • once the broker is started the broker id can't be changed at runtime – Liju John Apr 03 '18 at 11:19
  • As per my need, Broker ID won't be changed during runtime. But I don't want to pick the broker ID from server.properties. Rather I would like to pick it up programmatically from a master configuration file within my system. – Subash Kunjupillai Apr 03 '18 at 11:23
  • 1
    for that case , you will have to write some program which will create or update server.properties and pass it on to the broker startup script – Liju John Apr 03 '18 at 11:27
  • Can you explain what you're trying to do? Are you trying to connect to a different broker from within your Kafka program? Or you really want to programatically change the id of a running Kafka broker? – Robin Moffatt Apr 03 '18 at 13:45
  • As @LijuJohn highlighted, we have decided to update the server.properties file to update the broker.id before starting the broker. – Subash Kunjupillai Apr 04 '18 at 03:57

0 Answers0