grepplabs / kafka-proxy

Proxy connections to Kafka cluster. Connect through SOCKS Proxy, HTTP Proxy or to cluster running in Kubernetes.
Apache License 2.0
501 stars 87 forks source link

Add support for remapping brokers based on node id #22

Open mikekap opened 5 years ago

mikekap commented 5 years ago

Kafka allows brokers to advertise any IP, but they must have a consistent node id. It would be useful if kafka-proxy could key the IP replacement logic by node id as well as ip. For example, something like --bootstrap-server-mapping=NODE_ID:1,localhost:30001.

This would still require at least one --bootstrap-server-mapping that's not node id based, but it would provide a nice alternative in case the advertised hostnames aren't readily available and change over time.