-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support separation of Internal and External traffic by Broker (KIP-103) #859
Comments
Did merging your PR resolve this issue? |
@hyperlink yes, but only my first point. Not point 2: The kafka-node adapter currently selects the first endpoint that supports the protocol that is selected for usage by the kafka-node adapter. However, there may be multiple endpoints that use this protocol: for example both an INTERNAL as well as an EXTERNAL endpoint. In this case the EXTERNAL endpoint should be chosen as the endpoint that is used because the INTERNAL endpoint can not be reached by the client. So only if your ADVERTISED_LISTENERS states the endpoint to be used by kafka-node first. To resolve this some sort of mechanism must be built that selects the first endpoint that actually works. Because a kafka broker can have multiple endpoints, not all of which will be reachable necessarily. |
Is there a will to solve this issue in a near future? I confirm the problem in this same scenario (Docker env.) |
I know that ZkOptions are meant to be passed directly to Zookeeper, but as this listener selection problem only happens when using Zookeeper, maybe a new preferredListener option could be added to ZkOptions so if it is provided by the developer, that endpoint would be selected (EXTERNAL or OUTSIDE, or whatever name the listener was given) instead of the first one that matches the protocol. |
I have created a workaround branching from version 3.0.1 and using ZkOptions as I said before to selecte prederred listeners: |
Currently, kafka-node does not have support for brokers that are configured to have separate listeners for internal and external traffic. This was introduced in KIP-103.
There are 2 aspects to this KIP that are important:
Reproduction
To reproduce this, set up a Kafka broker that separates INTERNAL and EXTERNAL traffic. You can do this by setting up a Kafka Broker using Docker and using the following configuration:
The endpoint
broker:9092
is ment to be used used internally between the containers. The endpointlocalhost:3501
is used by external Kafka clients to connect to the broker.If you now run the example consumer.js for
zookeeper:3500
no suitable endpoint can be found because the advertised listeners with names EXTERNAL and INTERNAL are not mapped to the protocol PLAINTEXT. Moreover, if this mapping were in place, it would select the INTERNAL endpoint as a first match (see client.js line 126, function setupBrokerProfiles). However, the INTERNAL endpoint can not be used to access the broker from outside the Docker bridge network.The text was updated successfully, but these errors were encountered: