消息中间件功能对比

Intlgj 2012-01-18

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

版本

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官网声称:

ApacheActiveMQ ™ is the most popular and powerfulopen 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 ResourceAdapter)

Language clients

ActiveMQ much more than OpenMQ, whichsupport 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实现和其他企业应用组件的互联。

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

简单来说如果你有一个应用只提供一个JMS接口,而你的另一个应用提供WebServices接口,那你的路由规则可以这么定义:

from("jms://xxxx").to("cxf://xxxx)

【注】Camel通过CXF提供了对WebService的支持。

当然你有可能需要对JMS接口过来的消息做一些处理在转发给WebService应用。

那你只需在两个节点之间要加入一个processor来实现你需要做的处理就行了

from("jms://xxxx").processor(newMyProcessor()).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_Protocolactivemq和JORAM支持,H在2.0GA还没有,O没有。

 

 RESTfulAPI

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

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

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

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

Flow Control

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

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

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

 

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

 

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

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

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

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

Large Message

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

Hugemessage support

Sendandreceivemulti-gigabytemessagesfullyreliablyandtransactionallyeventhoughyourservermightberunninginonly50MiBofRAM!

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 diskspace, which is quite unlikely 消息中间件功能对比.

 

message persistence

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

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

HornetQhasnodependencyonclunky,slow,relationaldatabasesforpersistence.

关系型数据库太慢之类的,A好像还得用数据库。

ThejournalisauniquepieceoftechnologythatautomaticallydetectsifrunningonLinuxandusesLinuxAsynchronousIO(AIO)viaanativecodelayerforastonishingperformance.

IfAIOisnotavailableseamlesslyfallsbacktousingJavaNIO,sowillrunseamlesslyonanyJavaplatform.

Watch our competitors weep when they see it fly 消息中间件功能对比

 

 

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

JORAM provides message persistence usingits own built-in high performance journal.

TheJORAMpersistencesystemiscompletelypluggable,itdefinesaServiceProviderInterface(SPI)thatyoucanimplementinordertoplug-inanewimplementation.

JORAM is shipped with additionnal persistence modules using relationaldatabases for example.

Monitoring

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

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

for more complex events such as sendingmessages to a

destination without a consumer, advisorymessages 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-RabbitMQAMQP和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://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_ProtocolAMQP

相关推荐