[zeromq-dev] Quick question on usage of patterns
Chuck Remes
lists at chuckremes.com
Thu Jul 12 20:56:02 CEST 2012
On Jul 12, 2012, at 1:23 PM, Diffuser78 wrote:
> Hello All,
>
> I need some suggestion on my design and ways in which it can be done using ZMQ sockets.
>
>
> I have an app App1 on Box1. It sends a message M1 (128K) to an app App2 on Box2. App2 will do some processing on M1 before sending an ACK back. In my application, I also want to send an ACK back to App1 as soon as App2 receives M1, i.e. I want App2 to send two types of ACKs to App1:
> 1. An ACK that says that App2 received M1
> 2. An ACK after M1 is processed.
>
> Can I make App1 use Dealer socket and App2 Router ? How will the matching happen on App1's end ? If this pattern is not right, could you please point out the right pattern to use for this use case.
If you want to generalize this so that App1 can talk to App2, App3, App4 and App5 and each one can respond back properly, I would suggest using Dealer (on App1) and Router sockets on the remaining Apps. See the write up on the wiki (http://www.zeromq.org/tutorials:xreq-and-xrep) regarding how to format messages for talking between Dealer/Router (renamed from XREQ/XREP).
cr
More information about the zeromq-dev
mailing list