Warm tip: This article is reproduced from serverfault.com, please click

How to create ZeroMQ socket suitable both for sending and consuming?

发布于 2020-01-21 19:26:28

Could you please advice an ZeroMQ socket(s) architecture for the following scenario:

1) there is server listening on port

2) there are several clients connecting server simultaneously

3) server accept all connections from clients and provide bi-directional queue for each client, means both party (client N or server) can send or consume messages, i.e. both party can be INITIATOR of the communication and other party should have a callback to process the message.

Should we create additional ZeroMQ socket on each accepted connection for pushing messages from server? Could you please advice of which ZeroMQ socket type to google for such architecture?

Questioner
Anton Ovsyannikov
Viewed
0
user3666197 2020-01-22 04:46:37

Q : …create additional ZeroMQ socket on each accepted connection for pushing messages from server?

The best trivial composition-based design - both scaling-wise and security-wise

The native ZeroMQ primitives ( the smart primitive Scalable Formal Communications Pattern Archetypes ) are like a LEGO building-blocks for us - we compose their further use on the Messaging/Signalling Plane of the intended target use in our application-domain.

Q : Could you please advice of which ZeroMQ socket type to google for such architecture?

No, given no detailed requirements list was available for such an advice. A pair of PUSH/PULL-s need not suffice on their own, temporarily conducted ( episodic ) REQ/REP may help for the client-(re-)discovery phases, as might other co-existent, persistent or episodic Archetypes do for composing any additional System/Service-Planes.