Skip to content
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

BROADCAST_URL of Kafka cluster not getting parsed - #51

Open
Tracked by #113
rohitswarke opened this issue Aug 12, 2021 · 0 comments
Open
Tracked by #113

BROADCAST_URL of Kafka cluster not getting parsed - #51

rohitswarke opened this issue Aug 12, 2021 · 0 comments

Comments

@rohitswarke
Copy link

Issue: BROADCAST_URL for Kafka cluster doesn't get parsed correctly and throws KafkaConnectionError

Sample URL:
BROADCAST_URL = 'kafka://server1:port,server2:port,server3:port'

Description:
aiokafka client is using collect_hosts method of kafka.conn and while
kafka.conn.collect_hosts method collects a comma-separated set of hosts (host:port)
https://github.com/dpkp/kafka-python/blob/master/kafka/conn.py#L1485

In broadcaster._backends.kafka we are preparing bootstrap server by passing list of entire netloc string as shown below:
https://github.com/encode/broadcaster/blob/master/broadcaster/_backends/kafka.py#L13
self._servers = [urlparse(url).netloc]
If we tweak above line with below statement then it will support kafka cluster connection string:
self._servers = urlparse(url).netloc.split(',')

Do let me know your thoughts on this.

@alex-oleshkevich alex-oleshkevich mentioned this issue Apr 3, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant