zeromq

zeromq: how to prevent infinite wait?

我的梦境 提交于 2019-11-28 15:22:50
I just got started with ZMQ. I am designing an app whose workflow is: one of many clients (who have random PULL addresses) PUSH a request to a server at 5555 the server is forever waiting for client PUSHes. When one comes, a worker process is spawned for that particular request. Yes, worker processes can exist concurrently. When that process completes it's task, it PUSHes the result to the client. I assume that the PUSH/PULL architecture is suited for this. Please correct me on this. But how do I handle these scenarios? the client_receiver.recv() will wait for an infinite time when server

Why use AMQP/ZeroMQ/RabbitMQ

≯℡__Kan透↙ 提交于 2019-11-28 15:16:57
问题 as opposed to writing your own library. We're working on a project here that will be a self-dividing server pool, if one section grows too heavy, the manager would divide it and put it on another machine as a separate process. It would also alert all connected clients this affects to connect to the new server. I am curious about using ZeroMQ for inter-server and inter-process communication. My partner would prefer to roll his own. I'm looking to the community to answer this question. I'm a

Performance comparison between ZeroMQ, RabbitMQ and Apache Qpid

大城市里の小女人 提交于 2019-11-28 13:24:35
问题 I need a high performance message bus for my application so I am evaluating performance of ZeroMQ , RabbitMQ and Apache Qpid . To measure the performance, I am running a test program that publishes say 10,000 messages using one of the message queue implementations and running another process in the same machine to consume these 10,000 messages. Then I record time difference between the first message published and the last message received. Following are the settings I used for the comparison.

ZMQ DEALER - ROUTER Communication

蹲街弑〆低调 提交于 2019-11-28 12:59:19
I am currently working on a project that requires some communication over the network of a different data types from some entities of a distributed system and I am using ZMQ. The main goal of the project is to have a central node which services clients which can connect at any time. For each client connected, the central node should manage the message communication between the two. Currently, and by the moment, all communication is happening over TCP. The clients need to send and receive messages at any time so they are ZMQ_DEALER type sockets and the central node is ZMQ_ROUTER Initially, the

How to handle a Thread Issue in ZeroMQ + Ruby?

混江龙づ霸主 提交于 2019-11-28 11:16:16
Stumble upon reading ZeroMQ FAQ about a Thread safety. My multi-threaded program keeps crashing in weird places inside the ZeroMQ library. What am I doing wrong? ZeroMQ sockets are not thread-safe. This is covered in some detail in the Guide. The short version is that sockets should not be shared between threads. We recommend creating a dedicated socket for each thread. For those situations where a dedicated socket per thread is infeasible, a socket may be shared if and only if each thread executes a full memory barrier before accessing the socket. Most languages support a Mutex or Spinlock

Pyzmq high-water mark not working on pub socket

旧巷老猫 提交于 2019-11-28 11:06:34
问题 According to the ZeroMQ documentation a pub socket is supposed to drop messages once the number of queued messages reaches the high-water mark. This doesn't seem to work in the following example (and yes I do set the hwm before bind/connect): import time import pickle from threading import Thread import zmq ctx = zmq.Context() def pub_thread(): pub = ctx.socket(zmq.PUB) pub.set_hwm(2) pub.bind('tcp://*:5555') i = 0 while True: # Send message every 100ms time.sleep(0.1) pub.send_string("test",

ZMQ poll not working

耗尽温柔 提交于 2019-11-28 07:45:52
问题 When I run the following code, I get an error on the first call to zmq_poll (i.e. it returns -1 ). The zmq_errno() returns 128 and the zmr_strerror(128) call returns "Unknown error" . I have been using ZMQ with C++ for a while now without any problems, but I can't get a call to zmq_poll to work, no matter how simple it is. Calling zmq::version reveals that I am using ZMQ version 2.1.10. Does anyone have an idea as to why zmq_poll is failing? #include <zmq/zmq.hpp> int main(int argc, char*

How to protect ZeroMQ Request Reply pattern against potential drops of messages?

扶醉桌前 提交于 2019-11-28 04:19:48
问题 I'm trying to implement a ZeroMQ pattern on the TCP layer between a c# application and distributed python servers. I've gotten a version working with the request-reply REQ/REP pattern and it seems relatively stable when testing on localhost . However, in testing, I've debugged a few situations, where I accidently send multiple requests before receiving a reply which apparently is not acceptable. In practice the network will likely have lots of dropped packets and I suspect that I'll be

Compile C lib for iPhone

纵饮孤独 提交于 2019-11-28 01:36:47
问题 I'm trying to compile ZeroMQ C binding in order to be able to use it on iPhone, here is my configure options: ./configure --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 CFLAGS="-pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.1.2 -gdwarf-2 -mthumb -I/Library/iPhone/include -isysroot /Developer

“Server” to “Server” ZeroMQ communication

一个人想着一个人 提交于 2019-11-27 18:58:41
问题 I want to build a system that has the following architecture: +------------------+ +------------------+ | App1. 0mq client | <------> | App2. 0mq server | +------------------+ +------------------+ where App2 is a ZeroMQ server and it's a black box, and App1 is a ZeroMQ client, but it is in fact a frontend server. The frontend server will process some requests from the clients and then will communicate with the App2 server. Given that: At any point in time any of the "servers" can go down or