zeromq

What is the proper way to wait for connections?

自古美人都是妖i 提交于 2019-12-04 04:48:39
I am trying to implement a simple message passing between two applications using NetMQ (a slightly more elaborate description of what I am trying to achieve is below). After a bit of trial and error I've found that I can't just send or receive messages right away after a Connect/Bind calls, since they are non blocking and actually return even if the connection hasn't been established yet. For now I solved this with Thread.Sleep(), but this has a bad taste to it and definitely a no-go for a production system. So the question is, how's one supposed to do it in NetMQ/ZeroMQ? Client example: using

Retrieving subscriber count using zeromq PUB/SUB sockets

流过昼夜 提交于 2019-12-04 03:01:44
Is it possible to get the total count of subscribers from a PUB socket in zeromq? Thanks! Yes, but unfortunately not via any simple property or method. You need to use the zmq_socket_monitor() function to connect an inproc service socket to the main socket you want to observe. From there you can listen to events regarding connect/disconnect and keep your own count of subscribers. It may not be a trivial task though, since it seems (to me at least) a bit hard to know when to consider a subscriber (or any remote connection) to be up/down (closed/disconnected/retry etc.). You will have to play

DDS vs AMQP vs ZeroMQ [closed]

♀尐吖头ヾ 提交于 2019-12-04 02:05:54
I wanted a feedback on whether my evaluations and concerns are correct. I have been reseaching the three, Data Distribution Service, AMQP and ZeroMQ for sometime now for building a data transport layer in a datacenter. All the three look promising, yet i encountered some blocking issues in few. To give a context, my requirements are: Scale upto 500+ physical nodes, 1000+ publishers and subscribers. Support durable delivery of messages to take care of failing subscribers. The aggregated throughput should be north of 1 Million messages / sec Problems with AMQP: The Broker architecture seems to

ZeroMQ--使用jzmq进行编程

不羁的心 提交于 2019-12-03 23:17:05
一、环境搭建 wget http://download.zeromq.org/zeromq-2.1.7.tar.gz tar -xzf zeromq-2.1.7.tar.gz cd zeromq-2.1.7 ./configure make sudo make install git clone https://github.com/nathanmarz/jzmq.git cd jzmq ./autogen.sh ./configure make sudo make install 如果没有安装libtool、libuuid-devel则需要先安装,否则安装失败 yum install libtool yum install libuuid-devel 常见问题: 出现java.lang.UnsatisfiedLinkError: /usr/local/lib/libjzmq.so.0.0.0: libzmq.so.1: cannot open shared object file: No such file or directory异常 原因是未找到zmq动态链接库。 解决方法1:export LD_LIBRARY_PATH=/usr/local/lib 解决方法2:编辑/etc/ld.so.conf文件,增加一行:/usr/local/lib。再执行sudo

Troubles with zmq_bind() in ZeroMQ binding for MQL4 language

时光毁灭记忆、已成空白 提交于 2019-12-03 21:27:33
I am working on MT4 and used wrapper mql4zmq.dll as given in link https://github.com/AustenConrad/mql4zmq As I have followed all instruction and successfully loaded DLL as well as lib file at specific locations from pre-compiled. But it can not bind or connect with socket through zmq_connect(,) or zmq_bind(,) . Please some one help me to solve this problem. I am posting my code here // Include the libzmq.dll abstraction wrapper. #include <mql4zmq.mqh> //+------------------------------------------------------------------+ //| variable definitions | //+-------------------------------------------

How to import zeromq libraries in cmake?

≯℡__Kan透↙ 提交于 2019-12-03 17:39:41
问题 I'm just starting to learn how to work with zeromq libraries and using them in different C++ projects. The sample code that I wrote (actually copied from there tutorials)is this: // file: main.cpp // Hello World client in C++ // Connects REQ socket to tcp://localhost:5555 // Sends "Hello" to server, expects "World" back // #include <zmq.hpp> #include <string> #include <iostream> int main () { // Prepare our context and socket zmq::context_t context (1); zmq::socket_t socket (context, ZMQ_REQ)

Howto make zeromq PUB/SUB drop old messages instead of new (for realtime feeds)?

你。 提交于 2019-12-03 17:39:15
问题 Say I have a PUB server that zmq_send() 's realtime messages to SUB client. If client is busy and can not zmq_recv() messages quick enough, then messages will be buffered in client (and/or server). If the buffer grows too large (high water mark) then NEW messages will be dropped. For realtime messages this is the opposite of what one wants. OLD messages should be dropped to make place for NEW ones. Is there some way to do this? Ideally I would like the SUB client's receive queue to be either

zeromq.node installation error Ubuntu 12.04: ' node-gyp rebuild'

ε祈祈猫儿з 提交于 2019-12-03 14:44:53
I'm trying to install zeromq.node using: $ npm install zmq However, I keep getting the error below. Any help would be much appreciated. gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/npm/node_modules/node-gyp/lib/build.js:215:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:91:17) gyp ERR! stack at Process._handle.onexit (child_process.js:674:10) gyp ERR! System Linux 3.2.0-29-generic gyp ERR! command "node" "/usr/share/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/robot/code

Trying to build a distributed crawler with ZeroMQ

女生的网名这么多〃 提交于 2019-12-03 14:05:03
问题 I just started to learn ZeroMQ and want to build a distributed webcrawler as an example while learing. My idea is to have a "server", written in PHP, which accepts a url where the crawling should start. Workers (C# cli) will have to crawl that url, extract links, and push them back into a stack on the server. The server keeps sending urls in the stack to workers. Perhaps a redis will keep track of all crawled urls, so we dont crawl sites multiple times and have the ability to extract

Scaling WebSockets with a Message Queue

心不动则不痛 提交于 2019-12-03 13:36:33
问题 I have built a WebSockets server that acts as a chat message router (i.e. receiving messages from clients and pushing them to other clients according to a client ID ). It is a requirement that the service be able to scale to handle many millions of concurrent open socket connections, and I wish to be able to horizontally scale the server. The architecture I have had in mind is to put the websocket server nodes behind a load balancer, which will create a problem because clients connected to