This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
feat: default dynamic listener ip set to 0.0.0.0 #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Context: Most of the times, kafka brokers don't have an static IP. We just have one DSN such as
kafka.myserver.org
which resolves to a broker (or load balancer) which then discovers all the broker IPs at that moment, sending that info back to the Kafka client (this is standard Kafka protocol).Those brokers will need to map to a local port so they can be accessed by Kafka clients. Those ports are called Dynamic listeners in our app (and in https://github.com/grepplabs/kafka-proxy).
Those ports are opened binding to localhost, however
120.0.0.1
is used as binding IP, meaning127.0.0.1
only binds to local network interface, and won't be accessible from outside the machine. Meanwhile0.0.0.0
binds to all network interfaces allowing to do calls to those ports from anywhere (up to your firewall, security group, etc on top of it).Unless there is a strong reason for binding to
127.0.0.1
(I opened up an issue here grepplabs/kafka-proxy#89 ),0.0.0.0
by default will allow making external calls to the dynamic listeners, meaning they will be accessible from outside the machine.This might change if such strong reason is provided in https://github.com/grepplabs/kafka-proxy, but for now, binding to
0.0.0.0
will help a lot to avoid barriers when configuring the proxy, specially the first time.There is always a way to change that value to whatever the user wants, by setting the extra flag
default-listener-ip=<ip-here>
inEVENTGATEWAY_KAFKA_PROXY_EXTRA_FLAGS
env var.