中间件类型:

  • 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特点

  1. AMQP协议的开源实现,使用Erlang编写,维护时有语言障碍。

  2. 通过plugin完全支持STOMP 协议。

  3. 有Vmware的支持,RabbitMQ在云计算领域应该会有更多的特殊支持,架构会更适合云应用。

  4. 有SpringSource的商业支持,包括技术支持,培训。

  5. 支持持久化,不过只能使用它自己的数据库,不能使用mysql等。

  6. Python客户端是pika,编程灵活简单;java的客户端编程灵活简单

  7. 需要消息服务器存储转发消息。

  8. 消息延时是10ms级别。

ActiveMQRabbitMQ性能测试对比

持久化性能对比

非持久化性能对比

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的更多相关文章

  1. 关于消息队列的使用----ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ

    一.消息队列概述消息队列中间件是分布式系统中重要的组件,主要解决应用解耦,异步消息,流量削锋等问题,实现高性能,高可用,可伸缩和最终一致性架构.目前使用较多的消息队列有ActiveMQ,RabbitM ...

  2. 消息队列性能对比——ActiveMQ、RabbitMQ与ZeroMQ(译文)

    Dissecting Message Queues 概述: 我花了一些时间解剖各种库执行分布式消息.在这个分析中,我看了几个不同的方面,包括API特性,易于部署和维护,以及性能质量..消息队列已经被分 ...

  3. 转载:关于消息队列的使用----ActiveMQ,RabbitMQ,ZeroMQ,Kafka,MetaMQ,RocketMQ

    转载: http://blog.csdn.net/konglongaa/article/details/52208273

  4. 消息中间件ActiveMQ、RabbitMQ、RocketMQ、ZeroMQ、Kafka如何选型?

    最近要为公司的消息队列中间件进行选型,市面上相关的开源技术又非常多,如ActiveMQ.RabbitMQ.ZeroMQ.Kafka,还有阿里巴巴的RocketMQ等. 这么多技术,如何进行选型呢? 首 ...

  5. RabbitMQ,Apache的ActiveMQ,阿里RocketMQ,Kafka,ZeroMQ,MetaMQ,Redis也可实现消息队列,RabbitMQ的应用场景以及基本原理介绍,RabbitMQ基础知识详解,RabbitMQ布曙

    消息队列及常见消息队列介绍 2017-10-10 09:35操作系统/客户端/人脸识别 一.消息队列(MQ)概述 消息队列(Message Queue),是分布式系统中重要的组件,其通用的使用场景可以 ...

  6. ActiveMQ, RabbitMQ和ZeroMQ 选型关注点

    选择MQ时,主要关注的特性,可能就以下几个: 通信模式(是否满足业务场景): ActiveMQ: queue(producer/consumer), topic(publisher/subsriber ...

  7. Kafka、ActiveMQ、RabbitMQ、RocketMQ 区别以及高可用原理

    为什么使用消息队列 其实就是问问你消息队列都有哪些使用场景,然后你项目里具体是什么场景,说说你在这个场景里用消息队列是什么? 面试官问你这个问题,期望的一个回答是说,你们公司有个什么业务场景,这个业务 ...

  8. activemq、rabbitmq、kafka原理和比较

    一.activemq 虽然是java写的消息队列,但是提供Java, C, C++, C#, Ruby, Perl, Python, PHP各种客户端,所以语言上是没什么问题的.配置和使用,基本上是j ...

  9. 为什么使用消息队列?消息队列有什么优点和缺点?Kafka、ActiveMQ、RabbitMQ、RocketMQ 都有什么优点和缺点?

    面试题 为什么使用消息队列? 消息队列有什么优点和缺点? Kafka.ActiveMQ.RabbitMQ.RocketMQ 都有什么区别,以及适合哪些场景? 面试官心理分析 其实面试官主要是想看看: ...

随机推荐

  1. win7 远程桌面关机

    在任务管理器中, 打开运行窗口, 执行 shutdown -s 命令, 将在30秒后关闭win7, 如果需要更快, 加上 -t 10 参数 关于 shutdown 的命令行说明: C:\Users\R ...

  2. python执行linux shell管道输出内容

    干净不留痕,用过都说好. echo "print 1+1" |python

  3. 程序开发使用docker部署

    我们公司自己研发了一套 grand-line 系统,使用 docker 来部署项目. 我是第一批小白鼠,一开始网络差,build 一次要半个小时,连接进入 web shell 也很慢,部署一个微信项目 ...

  4. ORACLE查出表所有的触发器及触发器详细信息

    ORACLE查出表所有的触发器及触发器详细信息 一.查all_triggers表得到trigger_name Sql代码 select trigger_name from all_triggers w ...

  5. Ultra-QuickSort

    Description In this problem, you have to analyze a particular sorting algorithm. The algorithm proce ...

  6. Hadoop: MapReduce2的几个基本示例

    1) WordCount 这个就不多说了,满大街都是,网上有几篇对WordCount的详细分析 http://www.sxt.cn/u/235/blog/5809 http://www.cnblogs ...

  7. Eclipse工作常见问题总结

    一.Eclipse常见快捷键使用 自动完成单词:Alt+/ 重命名:Shift+Alt+r(统一改变字段或方法名) 生成getter/setter方法: Shift+Alt+s,然后r 删除当前行:C ...

  8. 分析cocos2d-x中的CrystalCraze示例游戏

    cocos2d-x自带了不少示例,以及几个比较简单的游戏,不过这些游戏都是用javascript binding(SpiderMonkey)做的,所以我猜测javascript binding可能是c ...

  9. Oracle 常用操作【01】修改、更新数据

    1. oracle 修改表名.列名.字段类型.添加表列.删除表列  alert table scott.test rename to test1--修改表名 alter table scott.tes ...

  10. Java 的世界,我不懂:奇葩的 json 序列化

    先上张图,代表我心中的十万头草泥马: 写这么长的代码,头回见数组和单个实体共用同一个 json 节点的! 恐怕只有 java 社区的大牛B 才能做出这等事.. 由 Apache 发布: http:// ...