Q : Recommended pattern for inproc clients from multiple threads pushing ordered messages to a server?
Any answer to such formulated question is dependent on a missing piece of information: what is the set o preferences, that lead to distinguish between insufficient, sufficient, better and best solution to the above described operations.
Do you need a confimatory feedback from server to client as there is Zero-Warranty for a message delivery?
Do you need to handle a static or a dynamic set of clients?
Do you prefer performance to RAM-footprint?
Without any of these "criteria" expressed a serious man would never "recommend", as any such statement would be a just opinion.
PUSH/PULL
may suffice for unconfirmed delivery ( an optimistic blindness use-case, if an out-of-sight out-of-mind design philosophy is acceptable in production )
PAIR/PAIR
may suffice for a fast .poll( ZeroWait, ZMQ_POLLIN )
server-side scanner, with server-side POSACK-responses being possible to dispatch to respective client-threads, whose messages were delivered and accepted for server-side processing ( user-defined message-confirmation handshaking protocol, handling POSACKs / NACK-timeouts / out-of-order escallations etc, goes beyond the scope of this post )
PUB/SUB
or XPUB/XSUB
may suffice for some more tricky management of topic-based signalling, bidirectional in the X-versions, if that justifies the add-on costs of topic-filtering overheads ( depending on ZeroMQ version, whether distributed over all client-threads, or centralised on the server-thread side )
The decision is yours.
streamer
mentioned, it is just a pattern not a basic socket provided byzmq
and is used when you want to distribute the message to many servers. – Shishir Pandey