[zeromq-dev] If not Majordomo for asynchronous workers, then what?
Ivan Figueredo
ivan at blackpx.com
Thu Jul 26 21:29:53 CEST 2012
I am writing a distributed trading manager. There are many different
liquidity providers, and the client would like to route to a given
exchange. With this in mind, I thought that using the Majordomo pattern
with a broker in between clients and workers asking a particular [named]
worker to do its work. However at least as I understand it, Majordomo won't
work in this scenario.
Let's take the FIX protocol. Since FIX is asynchronous, I believe I can't
use the Majordomo. You may send an order to a FIX engine, and that one
order may send back many different messages. For example, that one order
may see the following responses: Insert, Pending, New, Partial Fill, then
finally Fill.
In the Majordomo pattern, a section of code in the worker looks like this
mdwrk session ("tcp://localhost:5555", sourceStr.c_str(), verbose);
zmsg *reply = 0;
while (1) {
zmsg *request = session.recv (reply);
if (request == 0) {
break; // Worker was interrupted
}
//reply = request; // Echo is complex... :-)
reply = new zmsg(sourceStr.c_str());
}
This assumes one request, and one reply. Since my application is not
strictly a single request, that gets a single response as in the code
above, do I have to drop Majordomo ?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120726/2ba529a6/attachment.htm>
More information about the zeromq-dev
mailing list