Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

BROADCAST_URL of Kafka cluster not getting parsed -  #51

@rohitswarke

Description

@rohitswarke

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions