zeromq

Performance comparison between ZeroMQ, RabbitMQ and Apache Qpid

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: 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. RabbitMQ : I used a "fanout" type

ZeroMQ: Address in use error when re-binding socket

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After binding a ZeroMQ socket to an endpoint and closing the socket, binding another socket to the same endpoint requires several attempts. The previous calls to zmq_bind up until the successful one fail with the error "Address in use" ( EADDRINUSE ). The following code demonstrates the problem: #include <cassert> #include <iostream> #include "zmq.h" int main() { void *ctx = zmq_ctx_new(); assert( ctx ); void *skt; skt = zmq_socket( ctx, ZMQ_REP ); assert( skt ); assert( zmq_bind( skt, "tcp://*:5555" ) == 0 ); assert( zmq_close( skt ) == 0 )

ZeroMQ doesn&#039;t auto-reconnect

匿名 (未验证) 提交于 2019-12-03 00:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've just downloaded and installed zeromq-4.0.5 on an Unbutu Precise (12.04) system. I've compiled the hello-world client ( REQ , connect, 127.0.0.1) and server ( REP , bind) written in C. I start the server. I start the client. Each second the client sends a message to the server, and receives a response. I press Ctrl- C to stop the server. The client tries to send its next outgoing message and it gets stuck in an never-returning epoll system call (as shown by strace ). I restart the server. The zmq_recv call in the client is still stuck,

ZeroMQ with msgpack, in C++, throws an invalid argument error [closed]

匿名 (未验证) 提交于 2019-12-03 00:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using zeromq to read data from an application which uses msgpack for serializing. The code compiles well but throws an invalid argument error when run. Where am I being wrong. Here is the error: terminate called after throwing an instance of 'zmq::error_t' what(): Invalid argument Abort (core dumped) Here's the code. #include <zmq.hpp> #include <iostream> #include <sstream> #include <msgpack.hpp> #include <string> int main(int argc, char *argv[]){ zmq::context_t context (1); // Open a req port to talk to application std::string addr =

ZeroMQ简单介绍

匿名 (未验证) 提交于 2019-12-03 00:34:01
ZeroMQ中的字符串是指定长度的,也就是不会向C语言中一样,使用0作为最后的字符串的表示。因此,当接受字符串数据的时候是纯净的字符串数据,需要你自己处理字符串结尾的工作。 ZeroMQ应用程序总是创建一个上下文开始,然后用它来创建套接字。应该在进程中只创建并使用一个上下文。上下文是单个进程中所有套接字的容器,并充当了inproc套接字的传输工具。 在主代码开始执行一个zmq_ctx_new(),在代码最后执行一个zmq_ctx_destory()。如果套接字没有关闭,则zmq_ctx_destory函数将一直挂起,即使关闭了所有的套接字,如果有悬而未决的连接或者发送,zmq_ctx_destory也将等待下去,除非你在关闭这些套接字之前将linger设置为0. 消息对象 套接字 上下文共同组成了ZeroMQ对象。 处理完消息的那一刻,总是用zmq_msg_close()关闭它。 当你退出程序的时候,关闭你的套接字,然后调用zmq_ctx_destory()销毁上下文。 不要在多线程中使用同一个套接字,记住不要这样做。 关闭每个有持续请求的套接字 首先设置一个低的linger值,然后关闭套接字。 最后是销毁上下文,这将导致连接到的线程的阻塞的接受或者是发送都将返回一个错误,捕获该错误,然后在该线程中设置linger,关闭套接字并退出,不要多次销毁同样的上下文,在主线程中的zmq

Kafka、RabbitMQ、RocketMQ等消息中间件的对比 ―― 消息发送性能和区别

匿名 (未验证) 提交于 2019-12-03 00:22:01
原文: http://jm.taobao.org/2016/04/01/kafka-vs-rabbitmq-vs-rocketmq-message-send-performance/?utm_source=tuicool&utm_medium=referral 分布式系统中,我们广泛运用消息中间件进行系统间的数据交换,便于异步解耦。现在开源的消息中间件有很多,前段时间我们自家的产品 RocketMQ (MetaQ的内核) 也顺利开源,得到大家的关注。 那么,消息中间件性能究竟哪家强? 带着这个疑问,我们中间件测试组对常见的三类消息产品(Kafka、RabbitMQ、RocketMQ)做了性能比较。 Kafka是LinkedIn开源的分布式发布-订阅消息系统,目前归属于Apache定级项目。Kafka主要特点是基于Pull的模式来处理消息消费,追求高吞吐量,一开始的目的就是用于日志收集和传输。0.8版本开始支持复制,不支持事务,对消息的重复、丢失、错误没有严格要求,适合产生大量数据的互联网服务的数据收集业务。 RabbitMQ是使用Erlang语言开发的开源消息队列系统,基于AMQP协议来实现。AMQP的主要特征是面向消息、队列、路由(包括点对点和发布/订阅)、可靠性、安全。AMQP协议更多用在企业系统内,对数据一致性、稳定性和可靠性要求很高的场景,对性能和吞吐量的要求还在其次。

四款消息队列的对比

匿名 (未验证) 提交于 2019-12-02 23:49:02
ActiveMQ和RabbitMQ的区别? 关于文章没多少内容,请进链接:https://blog.csdn.net/qq_30764991/article/details/80573352, https://blog.csdn.net/qq_30764991/article/details/80516961好多学习内容,请自行学习。关于赞赏码倒是挺大的,哈哈,这个你得感谢中国伟大的企业家教育家马云先生(JACK MA),这个是自愿的,你自己从支付宝那里赚取,你看或者不看它就在那里,且行且珍惜短暂的人生路。加油!every body!everyone!everystudent! 1. ActiveMQ/ApolloMQ   优点:老牌的消息队列,使用Java语言编写。对JMS支持最好,采用多线程并发,资源消耗比较大。如果你的主语言是Java,可以重点考虑。   缺点:由于历史悠久,历史包袱较多,版本更新很缓慢。集群模式需要依赖Zookeeper实现。最新架构的产品被命名为Apollo,号称下一代ActiveMQ,目前案例较少。 2. RocketMQ/Kafka   优点:专为海量消息传递打造,主张使用拉模式,天然的集群、HA、负载均衡支持。话说还是那句话,适合不适合看你有没有那么大的量。   缺点:所谓鱼和熊掌不可兼得,放弃了一些消息中间件的灵活性,使用的场景较窄

Sending messages from other languages to an IPython kernel

别等时光非礼了梦想. 提交于 2019-12-02 22:14:51
Does anyone have any experience of communicating with IPython kernels from outside of Python? If I were trying to send messages from a Python app to an IPython kernel, I'd use the zmq.kernelmanager API. As it is, I'll obviously need to write my own kernel manager in another language, but I can't find the information that I'm looking for about the low-level messaging protocols. Is there an official spec or a 'cheat sheet' that documents the structure of the actual messages that get sent over 0MQ? This page describes a higher-level protocol than what I'm looking for... Will I have to manually

How to use zeroMQ in Desktop application

偶尔善良 提交于 2019-12-02 20:59:46
I am working in a desktop application, where application is deployed in both windows and mac platforms. As part of the application, it should communicate with native layer. Currently the communication between native layer and Java layer is done using sockets. Recently some one in the team suggested to use zeroMQ. Can any one of you guys please clarify my doubts. How zeroMQ better than sockets Is it possible to install zeroMQ library as part the Desktop client installation I gone through the link ' https://github.com/zeromq/clrzmq4 ', it given libraries specific to amd64 and i386 processor

Reserve a TCP port in Windows

北城以北 提交于 2019-12-02 20:55:36
I'd like to reserve a TCP port, to be bound by a service later, so that Windows doesn't inadvertently use the same number when assigning random port numbers. I know this is possible via the registry and a reboot, but I would like to avoid such a heavy-handed solution. How can a process reserve a port without actually binding/listening to it, and then safely (i.e., avoiding race-conditions) hand it over to another process on request? The port number needn't be determined in advance. It's OK for the first process to acquire a random port number, and pass it to the requesting process. EDIT: It