zeromq

Implementing a message bus using ZeroMQ

非 Y 不嫁゛ 提交于 2019-12-03 12:52:51
I have to develop a message bus for processes to send, receive messages from each other. Currently, we are running on Linux with the view of porting to other platforms later. For this, I am using ZeroMQ over TCP. The pattern is PUB-SUB with a forwarder. My bus runs as a separate process and all clients connect to SUB port to receive messages and PUB to send messages. Each process subscribes to messages by a unique tag. A send call from a process sends messages to all. A receive call will fetch that process the messages marked with the tag of that process. This is working fine. Now I need to

Can ZeroMQ be used to accept traditional socket requests?

一世执手 提交于 2019-12-03 12:51:57
I'm trying to re-write one of our old Servers using ZeroMQ, for now I have the following Server setup, (which works for Zmq requests): using (var context = ZmqContext.Create()) using (var server = context.CreateSocket(SocketType.REP)) { server.Bind("tcp://x.x.x.x:5705"); while (true) { ... } This kind of setup works fine if I use the Zmq client library to connect context.CreateSocket(SocketType.REQ) But unfortunately we've got a lot of legacy code that needs to connect to this server and the sockets are created using .net socket libs: Socket = new Socket(ipAddress.AddressFamily, SocketType

Zeromq: How to access tcp message in c++

时光总嘲笑我的痴心妄想 提交于 2019-12-03 11:35:59
问题 I am a new-by to ZeroMQ and make my way through the C++ hello-world example of the echo client-server pattern (Request-Reply). The server looks like: // // Hello World server in C++ // Binds REP socket to tcp://*:5555 // Expects "Hello" from client, replies with "World" // #include <zmq.hpp> #include <string> #include <iostream> #include <unistd.h> int main () { // Prepare our context and socket zmq::context_t context (1); zmq::socket_t socket (context, ZMQ_REP); socket.bind ("tcp://*:5555");

WHY / WHEN using rather DDS instead of ZeroMQ? [closed]

十年热恋 提交于 2019-12-03 11:16:57
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I read the followings: DDS vs AMQP vs ZeroMQ http://mnb.ociweb.com/mnb/MiddlewareNewsBrief-201004.html And it seems that there is no benfit using DDS instead of zmq: the latency of zmq is better. It seem to me that the API of ZMQ is cleared and simple. I cant use ZMQ in order

Can't get ZeroMQ python bindings to receive messages over IPC

眉间皱痕 提交于 2019-12-03 10:46:23
I'm trying to achieve PUB/SUB over IPC. If I changed the code below so that the subscriber binds to "tcp://*:5000" and the publisher connects to "tcp://localhost:5000" it works, but I can't get it to work over IPC. What am I doing wrong? subscriber.py import zmq, json def main(): context = zmq.Context() subscriber = context.socket(zmq.SUB) subscriber.bind("ipc://test") subscriber.setsockopt(zmq.SUBSCRIBE, '') while True: print subscriber.recv() if __name__ == "__main__": main() publisher.py import zmq, json, time def main(): context = zmq.Context() publisher = context.socket(zmq.PUB) publisher

Redis Cluster vs ZeroMQ in Pub/Sub, for horizontally scaled distributed systems

只愿长相守 提交于 2019-12-03 10:07:50
If I were to design a huge distributed system whose throughput should scale linearly with the number of subscribers and number of channels in the system, which would be better ? 1) Redis Cluster (only for Redis 3.0 alpha, if its in cluster mode, you can publish in one node and subscribe in another completely different node, and the messages will propagate and reach you). The complexity of Publish is O(N+M) , where N is the number of subscribed clients and M is the number of subscribed patterns in the system, but how does it scale when in a Redis Cluster ? I accept educated guesses on this. 2)

Do you know any projects where ZeroMQ was used? Both success and failure stories are valuable [closed]

£可爱£侵袭症+ 提交于 2019-12-03 09:58:41
I'm interested in using ZeroMQ in a project, but I'd like to hear about other's experience with it. I did some searching but found only mongrel2 project. Have you heard about other projects where it is used? What companies use ZeroMQ in production? We replaced usage of Unix named pipes with ZeroMQ. The communication overhead is equally not noticeable. And we got additional benefits: No limit on the message size. Ability to send the messages to remote boxes. No need to write our own thread for non-blocking send. Ability to receive messages from multiple sources. The webserver Mongrel2 uses

ZeroMQ XPUB/XSUB Serious Flaw?

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: It seems as though the XPUB/XSUB socket types have a serious flaw that is difficult to work around: This is my implementation of that center node: #include <zmq.hpp> int main() { zmq::context_t context(1); //Incoming publications come here zmq::socket_t sub(context, ZMQ_XSUB); sub.bind("ipc://subscriber.ipc"); //Outgoing publications go out through here. zmq::socket_t pub(context, ZMQ_XPUB); pub.bind("ipc://publisher.ipc"); zmq::proxy(sub, pub, nullptr); return 0; } The problem is, of course, slow joiner syndrome. If I connect a new

Cannot import zmq in python (install issue)

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I can't seem to install pyzmq on my macbook (OSX 10.9.1) First call was to run: sudo pip install pyzmq There was an error that libzmq couldn't be found, and it appeared to try and compile the bundled version: jono@air:~ $ sudo pip install pyzmq Password: Downloading/unpacking pyzmq Downloading pyzmq-14.0.1.tar.gz (867kB): 867kB downloaded Running setup.py egg_info for package pyzmq no previously-included directories found matching 'docs/build' no previously-included directories found matching 'docs/gh-pages' warning: no directories found

hadoop+kafka+strom+flume第一步

旧城冷巷雨未停 提交于 2019-12-03 08:33:24
1、所有主机需要安装JDK,并配置JDK环境变量 2、所有主机安装SSH,并相互间实现无密访问 3、修改主机hosts :文件/etc/hosts,保证各机器通过机器名可以互访 4、安装 python 2.6及以上(storm用 ) 5、ZeroMQ Java代码 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 期间可能遇到一些软件ubuntu没有安装 sudo apt-get install xxx 安装即可 6、JZMQ 命令 git clone https: //github.com/nathanmarz/jzmq.git cd jzmq ./autogen.sh ./configure make sudo make install git的安装和配置 命令 sudo apt-get install git git config --global user.name author #将用户名设为author git config --global user.email author @corpmail .com #将用户邮箱设为author