pigato icon indicating copy to clipboard operation
pigato copied to clipboard

Multiple brokers?

Open DenisGorbachev opened this issue 10 years ago • 6 comments

Does PIGATO.Client really support connecting to multiple brokers? The code says this.socket.connect(this.broker) (single connect call), and original ZMQ guide says A subscriber can connect to more than one publisher, using one connect call each time (multiple connect calls). So, what's right? :)

Or am I missing the point of connect?

DenisGorbachev avatar Jul 13 '15 14:07 DenisGorbachev

The multiple broker support as described in the zmq official guide was part of pigato and removed after some time because it was useful only as a ventilator but was very hard to control.

I'm currently working on a new client class that can wrap multiple clients and used as a single client so we maintain the overall structure simple but at the same time we allow to track correctly requests states and handle network issues.

Does this sound good for you?

prdn avatar Jul 13 '15 15:07 prdn

Sounds great. Currently my client sends requests for various services. Would be great if each "subclient" were attached to a single service.

By the way, I'm planning to launch N clients, K brokers, M workers — all connecting/binding to the same addr. Is that a correct setup? (particularly worried about "K brokers" part)

DenisGorbachev avatar Jul 13 '15 18:07 DenisGorbachev

@DenisGorbachev , from what I know, ou can't have K brokers connected to the same addr. In order to solve this kind of problems, I am working on a special kind of worker, that one can call proxy, which will transfert requests from a broker to another.

maxired avatar Jul 16 '15 15:07 maxired

@maxired that is amazing

prdn avatar Jul 21 '15 07:07 prdn

@prdn , you might be interested in giving it a look -> https://github.com/maxired/pigato-proxy

For information, I also published https://github.com/maxired/pigato-cli , but this is not relevant to this issue.

maxired avatar Jul 21 '15 08:07 maxired

@maxired I'm looking to use pigato-proxy in some project :+1:

prdn avatar Jul 22 '15 10:07 prdn