SlideShare a Scribd company logo
ActiveMQ
作者: honno
时间: 2008.8
Email: honnom@163.com
目前研究和应用推广的开源项目:
概要
ActiveMQ
-JMS
- 特征
- 功能
- 实例
Active Mq JMS
JMS 简介
• ( 1 ) destination
• ( 2 ) product
• ( 3 ) consumer
• ( 4 ) broker
• ( 5 ) P2P,Pub/Sub
ActiveMQ 与 JMS
• JMS 是一种规范。
• ActiveMQ 是 JMS 规范的一种实
现, MOM 。
ActiveMQ 架构图
架构图
ActiveMQ 主要特征
特征 :
• (1)JMS1.1,J2EE1.4
• (2)J2EE servers(Tomcat,JBoss4,GlassFish,WebLogic…)
• (3) 多语言客户端( Java,C,C++,C#,Ruby,PhP )
• (4) 多种协议 (VM,TCP,SSL,UDP,multicast,JGroups…)
• (5)Spring
• (6)Ajax
• (7)CXF,Axis
• (8)REST
• (9)Message Groups,Virtual Destinations,Wildcards,Composite
Destinations
• (10) 持久化 (journal,JDBC)
• (11) 性能 (client-server,cluster,peer…)
ActiveMQ 功能介绍
• 多种协议
• 持久化
• 安全
• 群集
• 监控
• 其他
多种协议
URI: scheme:scheme-specific-part
• ( 1 ) VM vm://brokername
• ( 2 ) TCP tcp://host:port
• ( 3 ) SSL ssl://host:port
• ( 4 ) HTTP http://host:port
• ( 5 ) UDP udp://host:port
多种协议
• ( 6 ) peer peer://group/brokername
• ( 7 ) multicast multicast://IPAddress
• ( 8 ) static static(list uris)
• ( 9 ) failover failvoer(list uris)
• ( 10 ) discovery discovery://host:port
持久化
• 日志
<journaledJDBC journalLogFiles="5"dataDirectory="../mq-data" />
• 数据库
包括:
Derby,HSQL,MySQL,SQLServer,
Sybase,DB2,Oracle…
<journaledJDBC dataSource="#mysql-ds"/>
安全
• 认证
simpleAuthenticationPlugin
jaasAuthenticationPlugin
• 授权
authorizationPlugin
集群
• Master/Slave
• Network of Brokers
监控
• JMX
• Advisory Message
ActiveMQ 高级话题
• Wildcards
* 和 >
• Composite Destinations
<compositeQueue >
<forwardTo>
<queue … />
<topic … />
</forwardTo>
</compositeQueue>
• Message Groups
ActiveMQ 入门实例
• 实例说明:
• ActiveMQ 发送和异步接受文本类型消息的
简单功能
broker
• 启动
• BrokerService broker = new BrokerService();
try {
broker.addConnector("tcp://localhost:61616");
broker.start();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
producer
• 发送 : 生产 10 个文本消息,并发送 .
• MessageProducer producer =
• session.createProducer(destination);
TextMessage message
• =session.createTextMessage();
for (int i = 0; i < 10; i++) {
message.setText("This is message " +
• (i + 1));
producer.send(message);
}
consumer
• 接收
• MessageConsumer consumer =
session.createConsumer(destination);
PrintlnUtil.println("Consumering
Messages");
consumer.setMessageListener(this);
运行效果图
详细: http://www.opensourceforce.org/thread-249-1-1.html
更多资料
• 更多关于 SOA,ESB,MQ 的相关资料见:
• 开源力量
谢 谢

More Related Content

PPTX
谈谈模块化
PPT
java title
PPT
ESB介紹_鄭世梧
PDF
大众点评网的技术变迁之路
KEY
a glance of Javascript module
PPT
02.web sphere培训 应用websphere
PPTX
ASP.net MVC
PDF
Mq light in microservices
谈谈模块化
java title
ESB介紹_鄭世梧
大众点评网的技术变迁之路
a glance of Javascript module
02.web sphere培训 应用websphere
ASP.net MVC
Mq light in microservices

Viewers also liked (6)

PPTX
Active mq Installation and Master Slave setup
PDF
ActiveMQ In Action
PDF
Messaging With ActiveMQ
PDF
Messaging for IoT
PPTX
Messaging for Web and Mobile with Apache ActiveMQ
PDF
Advanced messaging with Apache ActiveMQ
Active mq Installation and Master Slave setup
ActiveMQ In Action
Messaging With ActiveMQ
Messaging for IoT
Messaging for Web and Mobile with Apache ActiveMQ
Advanced messaging with Apache ActiveMQ
Ad

Active Mq JMS