Comments (6)
I've used the following before (on another protocol) and have implemented and using this on zmq.
Central broker uses XSUB/XPUB and listens for and republishes 'HELLO' messages.
It may also maintain a list of service endpoints and responds to requests
for the service list.
Client connects to central broker subscribing to HELLO messages.
Client sends HELLO message contains list (service name, listen socket) it provides.
Client ignores HELLO messages sent from self.
When client receives HELLO message from other clients, update internal
registry of service names, with socket endpoints.
Client responds to HELLO with a OLLEH (or some other message) with it's
service list, or the broker can respond to the joining client with the current
service list.
When a 'client' wants to send to service name, initiate connection endpoint with
service by service name.
If expecting async reply, create unique 'reply' service name on local 'client's'
listener endpoint. Include REPLY (service name, listen socket) in the protocol
message to service.
On zmq there's the 'slow initial connection problem' so you may have
establish the pub/sub connection between services during service registration
instead of at message initiation.
On the Central broker, when sockets close, remove the service from the list
and broadcast GOODBYE with service name(s) to all clients.
from zguide.
Dafka uses the approach you described. Have a look the central tower (https://github.com/zeromq/dafka/blob/master/src/dafka_tower.c) and the beacons used in the peers of the network (https://github.com/zeromq/dafka/blob/master/src/dafka_beacon.c)
from zguide.
Thanks for these fast and promising answers.
Dafka seems to fit very well.
If i may ask @sappo , as you are a maintainer of Dafka as well:
Has it been tested on 20.04 LTS? I have some dependencies problems with leveldb upon configuring even though i installed it (apt install libleveldb-dev)
from zguide.
@SegfaultCreator I do my development on 20.04, so it should work!
from zguide.
@sappo Great to hear that you have it running under 20.04!
Unfortunately, i still get linking errors with leveldb after trying out clang-11 with lld-11 and gcc with gnu-ld linker. Do you have any special installation of leveldb or did you also use the liblevel-db-dev=1.22-3ubuntu2 provided by ubuntu repository?
from zguide.
No I don't have any special installation. This is what apt says I have installed:
libleveldb-dev/focal,now 1.22-3ubuntu2 amd64 [installed]
libleveldb1d/focal,now 1.22-3ubuntu2 amd64 [installed,automatic]
from zguide.
Related Issues (20)
- Contradicting description of zero copy receive
- Update to Python examples HOT 1
- hwserver and hwclient erlang example with Chumak
- SUB or XSUB? HOT 4
- C++ examples - ppqueue.cpp : Can't send reply to client
- `examples/C#` causes errors in deployment HOT 3
- Erlang hwserver, hwclient links missing from guide
- cppzmq docs for poll are wrong HOT 3
- wuserver, wuclient Erlang examples not using Chumak
- Erlang files for taskvent, taskwork, tasksink do not use chumak
- zmq guide can not change programming language HOT 9
- Erlang scripts for lpserver and lpclinet not present HOT 1
- Trying to get in touch regarding a security issue
- REQ socket drop message silently if two message coming together very fast
- Pub-Proxy-Sub Mode,High frequency sending long message,easy to cause release error after cache application HOT 2
- C++mdworker,the example running in the linux aborted after throwing an ewhat
- "Experimental" status of ZMQ_PAIR sockets. HOT 6
- Sample clonecli4 does Not Work Due to KVSimple not Handling SUBTREE
- rtreq.cpp
- may be a bug that ttl not handle in pending list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zguide.