I am using Zmq in my Centos. My task is to write a java program using ZMQ which will have one producer and multiple consumers. If a Producer send 100 message and there are four consumers all the consumers must share 25 message each. How can I do this.
I myself had found the way. We have to use a broker to solve this and the broker must have two sockets for frontend and backend connectivity. Then there are several classes available in ZMQ like streamer, queue and forwarder. We can create object for this class by passing the context, frontend, backend as the parameters for the constructor. Just make the broker to wait by calling the run method.