ZeroMQ vs Crossroads I/O

Crossroads.io is pretty dead since Martin Sustrik has started on a new stack, in C, called nano: https://github.com/250bpm/nanomsg Crossroads.io does not, afaik, implement ZMTP/1.0 nor ZMTP/2.0 but its own version of the protocol. Nano has pluggable transports and we’ll probably make a ZMTP transport for that. Nano is really nice, a rethinking of the original … Read more

ZeroMQ/ZMQ Push/Pull pattern usefulness

It’s not a load balancer, this was a faulty explanation that stayed in the 0MQ docs for a while. To do load-balancing, you have to get some information back from the workers about their availability. PUSH, like DEALER, is a round-robin distributor. It’s useful for its raw speed, and simplicity. You don’t need any kind … Read more

How does zmq poller work?

When you need to listen on different sockets in the same thread, use a poller: ZMQ.Socket subscriber = ctx.socket(ZMQ.SUB) ZMQ.Socket puller = ctx.socket(ZMQ.PULL) Register sockets with poller (POLLIN listens for incoming messages) ZMQ.Poller poller = ZMQ.Poller(2) poller.register(subscriber, ZMQ.Poller.POLLIN) poller.register(puller, ZMQ.Poller.POLLIN) When polling, use a loop: while( notInterrupted()){ poller.poll() //subscriber registered at index ‘0’ if( poller.pollin(0)) … Read more

What are zeromq use cases?

Let’s say you want to have a bulletin board of some kind. You want to allow only some people to see it, by subscribing to the bulleting board. This can be done using the publisher/subscriber model of ZeroMQ. Now, let’s say you need to send some asynchronous messages. That is, when a message is sent … Read more

grpc and zeromq comparsion

async req / res communication (inproc or remote) between nodes Both libraries allow for synchronous or asynchronous communication depending on how to implement the communication. See this page for gRPC: http://www.grpc.io/docs/guides/concepts.html. Basically gRPC allow for typical HTTP synchronous request/response or a ‘websocket-like’ bidirectional streaming. For 0mq you can setup a simple REQ-REP connection which is … Read more

Why use AMQP/ZeroMQ/RabbitMQ

what makes them better than writing your own library? When rolling out the first version of your app, probably nothing: your needs are well defined and you will develop a messaging system that will fit your needs: small feature list, small source code etc. Those tools are very useful after the first release, when you … Read more

Why doesn’t zeromq work on localhost?

As @fdb points out: The problem is at line: subscriber.bind(“tcp://localhost:5555”) try to change to: subscriber.bind(“tcp://127.0.0.1:5555”) However this deserves more explanation to understand why. The documentation for zmq_bind explains (bold emphasis mine): The endpoint argument is a string consisting of two parts as follows: transport://address. The transport part specifies the underlying transport protocol to use. The … Read more

zeromq: how to prevent infinite wait?

If you are using zeromq >= 3.0, then you can set the RCVTIMEO socket option: client_receiver.RCVTIMEO = 1000 # in milliseconds But in general, you can use pollers: poller = zmq.Poller() poller.register(client_receiver, zmq.POLLIN) # POLLIN for recv, POLLOUT for send And poller.poll() takes a timeout: evts = poller.poll(1000) # wait *up to* one second for … Read more

Performance comparison between ZeroMQ, RabbitMQ and Apache Qpid

RabbitMQ is probably doing persistence on those messages. I think you need to set the message priority or another option in messages to not do persistence. Performance will improve 10x then. You should expect at least 100K messages/second through an AMQP broker. In OpenAMQ we got performance up to 300K messages/second. AMQP was designed for … Read more

tech