![]() Change the socket type to req on the server and rep on the client.connect ( ' tcp://127.0.0.1:9998 ' ) Īs you can see, the only changes we’ve had to make are: function logToConsole ( message ) ) // Connect to the server instance. socket ( " push " ) var counter = 0 // Just a helper function for logging to the console with a timestamp. Var zmq = require ( " zmq " ) var socket = zmq. Once ZeroMQ is setup, open a command line window or terminal and navigate to the folder you wish to place your Node.js files in and run the following command to download the Node.js bindings: If running on a UNIX like system however, you will have to build it yourself using the instructions found on the website. If you’re running Windows you can go ahead and grab the latest install wizard. Setting Up Our Environmentīefore we can get started developing with ZeroMQ, you’ll have to head over to the website at and install the latest version. Once one of the client applications exits, the remaining application continues to process all messages being pushed out making this a great solution for situations where a worker may go down unexpectedly. ![]() ![]() As you can see, once we start the second application, the client applications alternate in pulling messages to process. On the left, we have the application that is pushing the messages and on the right, we have two applications pulling the messages.
0 Comments
Leave a Reply. |