| It is much cleaner and
faster to just send a multipart message using zeromq. The multipart is
still considered a single ZMQ message and will be delivered atomically.
The guide has some more examples. Joshua It would look something like this: import org.zeromq.ZMQ; String xml = "<somexml/>" byte[] attachment = new byte[]{1, 2, 3, 4}; ZMQ.Context context = ZMQ.context(1); ZMQ.Socket push = context.socket(ZMQ.PUSH); push.connect("tcp://127.0.0.1:1234"); ZMQ.Socket pull = context.socket(ZMQ.PULL); pull.bind("tcp://*:1234"); push.send(xml.getBytes(), ZMQ.SND_MORE); push.send(attachment, 0); String rxml = new String(pull.recv(0)); byte[] rattachment = pull.recv(0);
|
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev

