ZeroMQ

Socket Types

The core ZeroMQ socket types are grouped into the following primary messaging patterns:


Request-Reply Pattern

This pattern connects clients to services and is used for remote procedure calls and task distribution.


Publish-Subscribe Pattern

This pattern connects publishers to subscribers and is used for data distribution (fan-out).


Pipeline Pattern

This pattern connects nodes in a fan-out/fan-in flow for parallel task distribution and collection.


Exclusive Pair Pattern

This pattern connects two sockets exclusively, typically for inter-thread communication within the same process.


Examples

A complete list of examples can be found here.


Heartbeat Example

A basic heartbeater using PUB and ROUTER sockets. pings are sent out on the PUB, and hearts are tracked based on their DEALER identities. You can start many hearts with heart.py, and the heartbeater will monitor all of them, and notice when they stop responding.


Definitive ZeroMQ Guide


Links