ActiveMQ;RabbitMQ;ZeroMQ
中间件类型:
Embedded middleware: As the name suggests, this typeof middleware handles embedded applications (software or firmware)。
RPC middleware: RPC (Remote Procedure Call)middleware communicates with applications using calls。
Object request broker: Here, applications can sendand receive objects, like CORBA。
SQL-oriented data access middleware: Primarily meantfor database-related applications, this class of middleware sits betweenapplications that communicate with databases, like JDBC,ODBC。
Message-oriented middleware(MOM): Message-oriented middleware mediate thecommunication or messages, between applications。
常见的三款开源消息中间件:
ActiveMQ
ActiveMQ是Apache开发的开源消息中间件,Java实现,基于JMS1.1及J2EE 1.4规范。
RabbitMQ
RabbitMQ 是由 LShift 提供的一个 Advanced MessageQueuing Protocol (AMQP) 的开源实现,由以高性能、健壮以及可伸缩性出名的 Erlang 写成,因此也是继承了这些优点。
ZeroMQ
ZeroMQ是由iMatix公司使用C语言开发的高性能消息中间件,是对socket的封装,在发送端缓存消息。
ActiveMQ架构
Queue Region是P2P消息模型,Topic Region是Publish/Subscribe模型。
Connectors负责消息通信,支持OpenWire, Stomp,REST,WS Notification, XMPP等协议。
Network Services负责存储转发,集群等服务。
Message Store负责消息的存储,支持内存、文件、内嵌数据库和外部数据库等四种消息持久化方式。
ActiveMQ特点
支持多语言:Java, C, C++,C#, Ruby, Perl, Python, PHP
消息模型:
Point to Point
Publish/Subscribe
协议支持情况:
支持OpenWire,Stomp,REST,WS Notification,XMPP。
对于python仅支持Stomp 协议。
不支持AMQP协议。
支持STOMP 1.0,不支持STOMP 1.1。
支持Spring,可以很容易集成到Spring,并用Spring脚本配置。
支持Clustering built-in with autodiscovery,可以互相自动发
有Apache的支持,持续发展的优势明显。
支持Python的clients,都是很微小的开源项目,编程较复杂,不灵活:
Pyactivemq——基本已经不在维护,活跃度为低。
stomppy——推荐使用,rhel还有相应的rpm包,活跃度为中。
需要消息服务器存储转发消息。
消息延时是10ms级别。
RabbitMQ架构
RabbitMQ包括虚拟主机(virtualhost),交换机(exchange),队列(queue)和绑定(binding)四个概念。
virtualhost:持有一组exchange、queue及bingding,可以做权限控制。
Queue:存放消息,由consumer建立,并绑定到Exchange。
Exchange:根据绑定的规则进行消息转发。
Binding:绑定规则。
RabbitMQ特点
AMQP协议的开源实现,使用Erlang编写,维护时有语言障碍。
通过plugin完全支持STOMP 协议。
有Vmware的支持,RabbitMQ在云计算领域应该会有更多的特殊支持,架构会更适合云应用。
有SpringSource的商业支持,包括技术支持,培训。
支持持久化,不过只能使用它自己的数据库,不能使用mysql等。
Python客户端是pika,编程灵活简单;java的客户端编程灵活简单
需要消息服务器存储转发消息。
消息延时是10ms级别。
ActiveMQ与RabbitMQ性能测试对比
持久化性能对比
非持久化性能对比
ZerorMQ特点
是对socket的封装与扩展,API和socket编程的方式基本一致,支持请求-响应、Publish/Subscribe等消息模式。
仅支持异步I/O,为了提高性能通过新建的线程发送消息。
不需要单独的消息服务器来存储转发消息,重点放在消息的传输上,性能高于TCP。
支持C, C++, Java,Python等20多种语言。Java的开发包是jzmq,python的开发包是pyzmq。
消息延时是微秒级别。
由imatix开发,并可以提供支持与培训。 imatix 是AMQP协议最初的creator,并开发了开源的OpenAMQ ,但是在2010年imatix 宣布iMatix to drop OpenAMQ support by 2011, AMQP it now believes it is “fundamentally flawed and unfixable”。目前主要将精力集中到ZeroMQ。
zeroMQ——摘自zguide
Itturns out that building reusable messaging systems is really difficult, whichis why few FOSS projects ever tried, and why commercial messaging products arecomplex, expensive, inflexible, and brittle. In 2006 iMatix designed AMQP whichstarted to give FOSS developers perhaps the first reusable recipe for amessaging system. AMQP works better than many other designs butremains relatively complex, expensive, and brittle.It takes weeks to learn to use, and months to create stable architectures thatdon't crash when things get hairy.
Mostmessaging projects, like AMQP, that try to solve this long list of problems ina reusable way do so by inventing a new concept, the "broker", thatdoes addressing, routing, and queuing. This results in a client-server protocolor a set of APIs on top of some undocumented protocol, that let applicationsspeak to this broker. Brokers are an excellent thing in reducing the complexityof large networks. But addingbroker-based messaging to a product like Zookeeper would make it worse, notbetter. It would mean adding an additional big box, and a new single point offailure. A broker rapidly becomes a bottleneck and a new risk to manage. Ifthe software supports it, we can add a second, third, fourth broker and makesome fail-over scheme. People do this. It creates more moving pieces, more complexity,more things to break.
Anda broker-centric set-up needs its own operations team. You literally need towatch the brokers day and night, and beat them with a stick when they startmisbehaving. You need boxes, and you need backup boxes, and you need people tomanage those boxes. It is only worth doing for large applications with manymoving pieces, built by several teams of people, over several years.
Sosmall to medium application developers are trapped. Either they avoid networkprogramming, and make monolithic applications that do not scale. Or they jumpinto network programming and make brittle, complex applications that are hardto maintain. Or they bet on a messaging product, and end up with scalableapplications that depend on expensive, easily broken technology. There has beenno really good choice, which is maybe why messaging is largely stuck in thelast century and stirs strong emotions. Negative ones for users, gleeful joyfor those selling support and licenses.
ActiveMQ | RabbitMQ | ZeroMQ | |
遵循规范 | JMS1.1及J2EE 1.4 | AMPQ | --- |
架构模型 | 消息代理架构Broker | 消息代理架构Broker | C/S架构 |
实现语言 | Java | Erlang | C/C++ |
支持消息协议 | Stomp | AMPQ、Stomp等 | --- |
主要推动力量 | Apache、Redhat | Lshift、Vmware、SpringSource | iMatix |
支持编程语言 | C,Java,Python | C,Java,Python | C,Java,Python |
编程复杂度 | 复杂 | 简单 | 中等 |
持久化 | 支持 | 支持,不支持第三方数据库 | 发送端缓存 |
性能 | Normal | Normal | High |
内存使用率 | High | High | Normal |
ActiveMQ;RabbitMQ;ZeroMQ的更多相关文章
- 关于消息队列的使用----ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ
一.消息队列概述消息队列中间件是分布式系统中重要的组件,主要解决应用解耦,异步消息,流量削锋等问题,实现高性能,高可用,可伸缩和最终一致性架构.目前使用较多的消息队列有ActiveMQ,RabbitM ...
- 消息队列性能对比——ActiveMQ、RabbitMQ与ZeroMQ(译文)
Dissecting Message Queues 概述: 我花了一些时间解剖各种库执行分布式消息.在这个分析中,我看了几个不同的方面,包括API特性,易于部署和维护,以及性能质量..消息队列已经被分 ...
- 转载:关于消息队列的使用----ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ
转载: http://blog.csdn.net/konglongaa/article/details/52208273
- 消息中间件ActiveMQ、RabbitMQ、RocketMQ、ZeroMQ、Kafka如何选型?
最近要为公司的消息队列中间件进行选型,市面上相关的开源技术又非常多,如ActiveMQ.RabbitMQ.ZeroMQ.Kafka,还有阿里巴巴的RocketMQ等. 这么多技术,如何进行选型呢? 首 ...
- RabbitMQ,Apache的ActiveMQ,阿里RocketMQ,Kafka,ZeroMQ,MetaMQ,Redis也可实现消息队列,RabbitMQ的应用场景以及基本原理介绍,RabbitMQ基础知识详解,RabbitMQ布曙
消息队列及常见消息队列介绍 2017-10-10 09:35操作系统/客户端/人脸识别 一.消息队列(MQ)概述 消息队列(Message Queue),是分布式系统中重要的组件,其通用的使用场景可以 ...
- ActiveMQ, RabbitMQ和ZeroMQ 选型关注点
选择MQ时,主要关注的特性,可能就以下几个: 通信模式(是否满足业务场景): ActiveMQ: queue(producer/consumer), topic(publisher/subsriber ...
- Kafka、ActiveMQ、RabbitMQ、RocketMQ 区别以及高可用原理
为什么使用消息队列 其实就是问问你消息队列都有哪些使用场景,然后你项目里具体是什么场景,说说你在这个场景里用消息队列是什么? 面试官问你这个问题,期望的一个回答是说,你们公司有个什么业务场景,这个业务 ...
- activemq、rabbitmq、kafka原理和比较
一.activemq 虽然是java写的消息队列,但是提供Java, C, C++, C#, Ruby, Perl, Python, PHP各种客户端,所以语言上是没什么问题的.配置和使用,基本上是j ...
- 为什么使用消息队列?消息队列有什么优点和缺点?Kafka、ActiveMQ、RabbitMQ、RocketMQ 都有什么优点和缺点?
面试题 为什么使用消息队列? 消息队列有什么优点和缺点? Kafka.ActiveMQ.RabbitMQ.RocketMQ 都有什么区别,以及适合哪些场景? 面试官心理分析 其实面试官主要是想看看: ...
随机推荐
- 编译php-5.6出错,xml2-config not found
今天在centos上编译PHP-5.6 cd php-5.6 ./configure --prefix=/usr/local/php5./ --with-apxs2=/usr/local/apache ...
- [转]nodejs npm常用命令
FROM : http://www.cnblogs.com/linjiqin/p/3765772.html npm是一个node包管理和分发工具,已经成为了非官方的发布node模块(包)的标准.有了n ...
- nginx架构
nginx平台初探(100%)
- SQL server 数据库备份还原Sql
/************ 一.数据库备份 ************/ --完整备份默认追加到现有的文件 backup database DBXS To disk='d:\backup\DBXS_fu ...
- scala 学习笔记(02) 元组Tuple、数组Array、Map、文件读写、网页抓取示例
package yjmyzz import java.io.PrintWriter import java.util.Date import scala.io.Source object ScalaA ...
- SlideAndDragListView,一个可排序可滑动item的ListView
SlideAndDragListView简介 SlideAndDragListView,可排序.可滑动item显示"菜单"的ListView. SlideAndDragListVi ...
- 细数Javascript技术栈中的四种依赖注入
作为面向对象编程中实现控制反转(Inversion of Control,下文称IoC)最常见的技术手段之一,依赖注入(Dependency Injection,下文称DI)可谓在OOP编程中大行其道 ...
- Windows 10 自动升级画面
- [BZOJ2438]杀人游戏(缩点+特判)
题目:http://www.lydsy.com:808/JudgeOnline/problem.php?id=2438 分析:如果出现了环,那么只要询问环上的一个人,那么环上其他的人的信息也就知道了, ...
- 数学符号“s.t.”的意义
在优化问题的求解中,如线性规划.非线性规划问题等,经常会遇到数学符号“s.t.”,它的意思是什么呢? “s.t.”,指 subject to,受限制于.... 例如: 目标函数:min {x+2} 约 ...