Re: [zeromq-dev] Many to many
That's wonderful, thank you. But, what about across servers? Wouldn't I need to rely on TCP? If so, can they also do this? Thanks, Lee Sent from my iPhone On 17 Feb 2013, at 07:48, Whitney Jackson whjack...@gmail.com wrote: I'm guessing the subs cannot connect to many? Guess again :) Here's a python example: # start sub.py import zmq c = zmq.Context() s = c.socket(zmq.SUB) s.setsockopt(zmq.SUBSCRIBE, '') s.connect('ipc://ep1') s.connect('ipc://ep2') while True: m = s.recv() print m print '' # end sub.py # start pub.py import time import zmq c = zmq.Context() s = c.socket(zmq.PUB) s.bind('ipc://ep1') s.bind('ipc://ep2') while True: print 'hi' s.send('hi') time.sleep(1) # end pub.py sub.py will print two 'hi's every second because it received one on ipc://ep1 and another on ipc://ep2. On Sun, Feb 17, 2013 at 1:22 AM, Lee Sylvester lee.sylves...@gmail.com wrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.com wrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Thank you, Justin. I had heard rumours, but its almost unfathomable :-D Lee Sent from my iPhone On 17 Feb 2013, at 07:33, Justin Karneges jus...@affinix.com wrote: Bind vs connect is independent of socket type. You can bind a SUB socket and connect many PUB sockets to it. So, you could have each service bind a PUB socket and a SUB socket, and then connect each to all other services' SUB sockets and PUB sockets respectively. On Sunday, February 17, 2013 07:22:27 AM Lee Sylvester wrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.com wrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Yeah sure. It'll work just fine with tcp endpoints. On Sun, Feb 17, 2013 at 2:11 AM, Lee Sylvester lee.sylves...@gmail.comwrote: That's wonderful, thank you. But, what about across servers? Wouldn't I need to rely on TCP? If so, can they also do this? Thanks, Lee Sent from my iPhone On 17 Feb 2013, at 07:48, Whitney Jackson whjack...@gmail.com wrote: I'm guessing the subs cannot connect to many? Guess again :) Here's a python example: # start sub.py import zmq c = zmq.Context() s = c.socket(zmq.SUB) s.setsockopt(zmq.SUBSCRIBE, '') s.connect('ipc://ep1') s.connect('ipc://ep2') while True: m = s.recv() print m print '' # end sub.py # start pub.py import time import zmq c = zmq.Context() s = c.socket(zmq.PUB) s.bind('ipc://ep1') s.bind('ipc://ep2') while True: print 'hi' s.send('hi') time.sleep(1) # end pub.py sub.py will print two 'hi's every second because it received one on ipc://ep1 and another on ipc://ep2. On Sun, Feb 17, 2013 at 1:22 AM, Lee Sylvester lee.sylves...@gmail.comwrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.comwrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Thank you, Whitney, you've made my day. I've been contemplating this part of my cloud over and over for days and was loath to do something complex when currently it's very simple and sleek. I can see ZMQ is a perfect fit :-D Regards, Lee Sent from my iPhone On 17 Feb 2013, at 08:15, Whitney Jackson whjack...@gmail.com wrote: Yeah sure. It'll work just fine with tcp endpoints. On Sun, Feb 17, 2013 at 2:11 AM, Lee Sylvester lee.sylves...@gmail.com wrote: That's wonderful, thank you. But, what about across servers? Wouldn't I need to rely on TCP? If so, can they also do this? Thanks, Lee Sent from my iPhone On 17 Feb 2013, at 07:48, Whitney Jackson whjack...@gmail.com wrote: I'm guessing the subs cannot connect to many? Guess again :) Here's a python example: # start sub.py import zmq c = zmq.Context() s = c.socket(zmq.SUB) s.setsockopt(zmq.SUBSCRIBE, '') s.connect('ipc://ep1') s.connect('ipc://ep2') while True: m = s.recv() print m print '' # end sub.py # start pub.py import time import zmq c = zmq.Context() s = c.socket(zmq.PUB) s.bind('ipc://ep1') s.bind('ipc://ep2') while True: print 'hi' s.send('hi') time.sleep(1) # end pub.py sub.py will print two 'hi's every second because it received one on ipc://ep1 and another on ipc://ep2. On Sun, Feb 17, 2013 at 1:22 AM, Lee Sylvester lee.sylves...@gmail.com wrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.com wrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.comwrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.com wrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
Bind vs connect is independent of socket type. You can bind a SUB socket and connect many PUB sockets to it. So, you could have each service bind a PUB socket and a SUB socket, and then connect each to all other services' SUB sockets and PUB sockets respectively. On Sunday, February 17, 2013 07:22:27 AM Lee Sylvester wrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.com wrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Many to many
I'm guessing the subs cannot connect to many? Guess again :) Here's a python example: # start sub.py import zmq c = zmq.Context() s = c.socket(zmq.SUB) s.setsockopt(zmq.SUBSCRIBE, '') s.connect('ipc://ep1') s.connect('ipc://ep2') while True: m = s.recv() print m print '' # end sub.py # start pub.py import time import zmq c = zmq.Context() s = c.socket(zmq.PUB) s.bind('ipc://ep1') s.bind('ipc://ep2') while True: print 'hi' s.send('hi') time.sleep(1) # end pub.py sub.py will print two 'hi's every second because it received one on ipc://ep1 and another on ipc://ep2. On Sun, Feb 17, 2013 at 1:22 AM, Lee Sylvester lee.sylves...@gmail.comwrote: Thank you for your reply, Witney, but I need it the other way. I need a sub socket to be connected to multiple pub endpoints... This is because every instance will have a single publisher, telling all who is interested about events, but that same service will want to list to an arbitrary number of other services for their events. Essentially, I'd be forming a type of mesh, where each service has two endpoint (pub and sub) and all connect to all. I knew pub could connect to many, as it binds, but I'm guessing the subs cannot connect to many? Thanks loads, Lee Sent from my iPhone On 17 Feb 2013, at 05:18, Whitney Jackson whjack...@gmail.com wrote: Is it possible for a sub socket to bind to multiple pub sockets? Yes. You can call bind and/or connect on a socket as many times at you like. If so, where is there an example of this? Here's an example from the guide where a pub socket is bound to multiple endpoints: http://zguide.zeromq.org/page:all#Getting-the-Message-Out If you connect a sub socket to multiple endpoints then it gets a message whenever any of the publishers to which it's connected send. On Sat, Feb 16, 2013 at 4:18 PM, Lee Sylvester lee.sylves...@gmail.comwrote: Hey guys, So, I want to do a many to many pubsub. I already have a discovery mechanism and logging, but what I need is for a service to bind to a pub socket and subscribe to a set list of instances of itself on the server and other servers. The Zyre framework, although awesome, seems a little large for my needs as I already have a number of the features it supplies built in to my framework. Is it possible for a sub socket to bind to multiple pub sockets? If so, where is there an example of this? Can I also add a pub socket to listen to when all is already running? Thanks, Lee ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev