ZeroMQ
Created on 2020-12-23T23:09:22-06:00
- ZeroMQ isn't interested in packaging your data. Bring your own serialization format.
- Frames are the length of data followed by the data.
- More than one frame can be packed in to a message; this is typically used for routing.
Sockets
- Request-reply (REP) socket: SEND a request and wait to RECV the answer.
- Publish-subscribe (SUB) socket: SUB to a number of topics; the server PUBs messages to one or more topics.
- Push-pull socket: PUSH messages to one or more PULL workers or have them all PUSH back to a single PULL worker. Basically, this is the fork-join socket type.
- XPUB and XSUB: used when sticking a proxy or message broker in between a pub-sub relationship. PUB -> XSUB -> proxy -> XPUB -> SUB.
- DEALER and ROUTER: a dealer connects to multiple request sockets, a router connects to multiple reply sockets. It is basically xsub/xpub but for request-reply instead.