Closed iangregsondev closed 1 year ago
@iangregsondev Did you read the ZeroMQ Guide? zmq.Poller or zmq.Reactor is the best way. Another approach that I am using is to use goroutine for each zmq.SUB, that's also working well.
Thank you @ahmetson , I am going to take a look.
Hi,
Can anybody lend a hand?
I have written a small test to receive messages from zmq, its working great, but currently, it's assuming that my subscribes all happen on the same Connection (endpoint)
What is needed to listen to multiple sockets (endpoints)
Here is my current setup, as you can see I am using
"tcp://127.0.0.1:29335"
I would like to connect to more than 1 endpoint as the messages maybe coming from multiple endpoints i.e.
"tcp://127.0.0.1:29335 "tcp://127.0.0.1:29336 "tcp://127.0.0.1:29337 "tcp://127.0.0.1:29338
and this is how I am listening, it does work because its on one endpoint.
I am unsure of the best way to accomplish this, I found some info about using Poller, but that confused me a little as I wasn't sure if I would lose messages.
I don't require to publish anything, i am only listening.
The quick and dirty way I thought of was creating multiple sockets and connections and multiple go routines to process the messages BUT I think that isn't the right solution ?
Thanks in advance.