How to use multiple kafka server in python-socketio? #1753
Unanswered
sparkingdark
asked this question in
Q&A
Replies: 2 comments 9 replies
-
The Kafka client code was not written by myself, it was contributed by a user. The option to pass multiple servers was not implemented by this user, so this is currently not possible. Would you be interested in extending the logic to optionally allow a list of URLs to be provided? |
Beta Was this translation helpful? Give feedback.
9 replies
-
Thanks for your reply.
I will do that and let you know by pr.
A live channel would be awesome but GitHub discussion is quite good.
…On Fri, 24 Dec, 2021, 10:07 pm Miguel Grinberg, ***@***.***> wrote:
Try something like this, so that you don't have to have separate logic for
connecting one or multiple servers, and also so that you apply the same
pre-processing to the list than it is currently applied to a single URL:
urls = [url] if isinstance(url, str) else url
self.kafka_urls = [url[8:] if url != 'kafka://' else 'localhost:9092' for url in urls]
self.producer = kafka.KafkaProducer(bootstrap_servers=self.kafka_urls)
self.consumer = kafka.KafkaConsumer(self.channel,
bootstrap_servers=self.kafka_urls)
And no, there is no live chat channel at this time. I don't have the
bandwidth to host one (have too many projects going on).
—
Reply to this email directly, view it on GitHub
<#1753 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL7XHCESLVO6IJYFL5J4YPTUSSOSZANCNFSM5KR2CYCQ>
.
You are receiving this because you authored the thread.Message ID:
<miguelgrinberg/Flask-SocketIO/repo-discussions/1753/comments/1867967@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a doubt regarding the python flask socketio that let's say I have a multi broker single zookeper kafka docker container running with address
now in kafka offical client I can create prodiucer and consumer
which will use all the server in case a load scenerio present. But in python sockerio I can only connect to a single instance of kafka broker so How can I pass all the multiple broker ip into the kafkamanager.
How can I pass like
Beta Was this translation helpful? Give feedback.
All reactions