消息中间件功能对比

几个月之前刚刚调研这部分时写的,有些东西已经和目前的理解不一样了,仅留存。可部分参考。

版本

H 2.0GA

Activemq 5.4.2(5.5 不支持 1.5 ,支持 1.6 )

JORAM 5.5

Popular

Goolge 搜索 openmq ,找到约 110,000 条结果

Goolge 搜索 activemq ,找到约 3,510,000 条结果

Goolge 搜索 Joram ,找到约 1,380,000 条结果

Goolge 搜索 Hornetq ,找到约 429,000 条结果

 

Activemq 官网声称:

Apache ActiveMQ ™ is the most popular and powerful open source messaging and Integration Patterns server

 

Architecture

JORAM: OSGi

OPENMQ: ??

Hornetq: 有自己的内核,和 JMS 无关,有可能是这个内核使得性能很好

ActiveMQ OSGi

Powerful

Specification

都符合:

JMS 1.1 Specification

Java EE 1.4 support (JCA 1.5 Resource Adapter)

Language clients

ActiveMQ much more than OpenMQ, which support only java, c

    ActionScript 3

    Ajax

    C

     C++

    C# and .Net

    Delphi and Delphi/FreePascal

    Erlang

    Flash / ActionScript

    Haskell

    JavaScript - Ajax or WebSockets

    Perl

    PHP

    Pike

    Python

    Ruby and Rails support via ActiveMessaging

    Smalltalk

WebSockets

大部分是通过 stomp 来实现的其他语言互通,比较 cool 的是 WebSockets (基于 stomp ),是 HTML 5 引入的一个东东。其他如 Ajax 是通过 Servlet

还有一部分是通过 OpenWire

Enterprise Integration Patterns

只有 A 提了这么个概念。

使用 Apache Camel 实现和其他企业应用组件的互联。

http://interview.group.iteye.com/group/wiki/1858-apache-camel

对于企业应用来说,由于历史或者多厂商等原因造成了其系统之间的通讯协议多样化,而由于企业业务发展,这些应用系统之间交互需求日益增多。 Apache Camel 可以帮助大家通过定义简单的路由规则来实现不同企业应用之间的互联互通。 Apache Camel 把不同的企业应用抽象成为 Endpoint 通过 URI 来对这些 Endpoint 进行描述,由于 Apache Camel 提供了一个基于 POJO 的企业应用模式 (Enterprise Integration Patterns) 的实现,同时 Camel 提供了 60 多个组件来负责具体的传输协 议,这样用户可以通过简单的消息路由规则定义,就可以实现各应用系统之间交互。

简单来说如果你有一个应用只提供一个 JMS 接口, 而你的另一个应用提供 WebServices 接口,那你的路由规则可以这么定义:
from("jms://xxxx").to("cxf://xxxx)
【注】 Camel 通过 CXF 提供了对 WebService 的支持。
当然你有可能需要对 JMS 接口过来的消息做一些处理在转发给 WebService 应用。
那你只需在两个节点之间要加入一个 processor 来实现你需要做的处理就行了
from("jms://xxxx").processor(new MyProcessor()).to("cxf://xxxx")

由上面的例子可以看到 Camel 的路由规则很直观简单,你可以像写 Java 代码一样定义路由规则。这得益于 Camel 的创建者 James Strachan (他也是 Groovy 的创建者)的贡献。

互操作 Protocols

我理解这部分就是指的互操作。

Stomp

O and A and H 都支持。

http://wikis.sun.com/display/GlassFish/OpenMQStompConnect

AMQP

http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol activemq JORAM 支持, H 2.0GA 还没有, O 没有。

 

 RESTful API

我理解是指用 HTTP 的方式暴露出 JMS 资源等服务的方式, activemq 支持, H 2.0GA 还没有, O 可以有,但看起来支持的不全面,如下文:

OpenMQ provide different transport protocol and access channels to access OpenMQ functionalities from different prgramming . One of the access channles which involve HTTP is named Universal Message Service (UMS) which provide a simple REST interaction template to place messages and comsume them from any programming language and device which can interact with a network server. UMS has some limitations which is simply understandable based on the RESTful nature of UMS. For current version of OpenMQ, it only supports Message Queues as destinations so there is no publish-subscribe functionality available.

其他 A 支持的互操作协议:

可以看出 A 对这部分的支持远远完善于其他产品。

Flow Control

见: http://www.c2b2.co.uk/iPoint/ipoint?SelectedPage=69&110ArticleID=17

When overloaded with messages, JBoss MQ and JBoss messaging suffered failures that brought the whole application server down. OpenMQ, in contrast, prevented the client from sending any more messages once the message queue reached a size limit. This behaviour protected the application server from failure.

这点之前的性能测试中出现过,超过某个值, mq 不再处理消息了。这点很好,尤其在 embeded 模式的时候。

 

流量控制我觉得和这个是一个东西: H J 都有比较好的流量控制,可以指定客户端发送条数或发送速率, A 也不差。这部分我觉得也比较重要,可以测试一下。

 

有趣的是, H J 的功能写的很像,有的句子几乎一样:)

http://community.jboss.org/wiki/HornetQFeatures

http://joram.ow2.org/features.html

Producer flow control.
JORAM provides a flow control mechanism to prevent clients overwhelming a server with messages. On a per connection basic you can specify the maximum rate, that a producer is allowed to send messages at.

Large Message

H 对这点很自信,可以支持 8G 消息,内存只有 50m

Huge message support

Send and receive multi-gigabyte messages fully reliably and transactionally even though your server might be running in only 50MiB of RAM!

We have tested up to 8GiB but theoretically you should be able to send / consume messages up to 2^63-1 bytes in size, assuming you have sufficient disk space, which is quite unlikely .

 

message persistence

消息持久化的支持上, H 也很自信

HornetQ provides message persistence using its own built-in, high performance journal.

HornetQ has no dependency on clunky, slow, relational databases for persistence.
关系型数据库太慢之类的, A 好像还得用数据库。
The journal is a unique piece of technology that automatically detects if running on Linux and uses Linux Asynchronous IO (AIO) via a native code layer for astonishing performance.

If AIO is not available seamlessly falls back to using Java NIO, so will run seamlessly on any Java platform.

Watch our competitors weep when they see it fly

 

 

J 也挺自信,而且可以换持久化实现

JORAM provides message persistence using its own built-in high performance journal.
The JORAM persistence system is completely pluggable, it defines a Service Provider Interface (SPI) that you can implement in order to plug-in a new implementation.
JORAM is shipped with additionnal persistence modules using relational databases for example.

Monitoring

三个都有,我认为 openmq 这部分做得够用了,甚至是很好了。

advisory messages A 提供的,比 JMX 更高级一些的诊断和监控,见《 ActiveMQ in Action 》一书,第 14.1.2 节:

for more complex events such as sending messages to a

destination without a consumer, advisory messages must be explicitly enabled. 如检测没有消费者订阅的 topic ,这部分需要自己定义监听器。

留待验证。

Performance

H 使用第三方机构提供的测试,测试用例为复杂用例是一个超市公司的用例。见 http://www.spec.org/jms2007/results/res2010q1/jms2007-20100119-00015.html

看样子 H 是最高的,需要测试。

HA

除了 O 没有(土),其他都有,一般都是共享磁盘和数据备份(只备份持久化的消息)。需要测试这个的功能。

其他记录

http://wikis.sun.com/display/GlassFish/OpenMQGlassfishQuestions 如何打印 ra 的日志

http://www.infoq.com/cn/articles/AMQP-RabbitMQ AMQP RabbitMQ 入门

http://community.jboss.org/wiki/HornetQOnJetty 集成 HornetQ Jetty

更多关于集成 HornetQ

http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/appserver-integration.html

http://hornetq.sourceforge.net/docs/hornetq-2.0.0.BETA5/user-manual/en/html/embedding-hornetq.html

http://www.iteye.com/news/10147-maven-hornetq-jboss

http://fendou.org/2010/05/20/amqp-instruction/ AMQP 协议介绍

 

http://java.dzone.com/news/jms-over-http-using-openmq-sun RESTful 字眼

http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol AMQP

猜你喜欢

转载自wanghui11.iteye.com/blog/1356396