狠狠撸

狠狠撸Share 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 的相关资料见:
? 开源力量
谢 谢
Ad

Recommended

谈谈模块化
谈谈模块化
衡锋 阳
?
java title
java title
lonegunman
?
贰厂叠介绍冲郑世梧
贰厂叠介绍冲郑世梧
Lawrence Huang
?
大众点评网的技术变迁之路
大众点评网的技术变迁之路
jeffz
?
a glance of Javascript module
a glance of Javascript module
zipeng zhang
?
02.web sphere培训 应用websphere
02.web sphere培训 应用websphere
littlecong
?
ASP.net MVC
ASP.net MVC
Guider Lee
?
Mq light in microservices
Mq light in microservices
Steve Upton
?
Active mq Installation and Master Slave setup
Active mq Installation and Master Slave setup
Ramakrishna Narkedamilli
?
ActiveMQ In Action
ActiveMQ In Action
Bruce Snyder
?
Messaging With ActiveMQ
Messaging With ActiveMQ
Bruce Snyder
?
Messaging for IoT
Messaging for IoT
Virtual JBoss User Group
?
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
dejanb
?
Advanced messaging with Apache ActiveMQ
Advanced messaging with Apache ActiveMQ
dejanb
?

More Related Content

Viewers also liked (6)

Active mq Installation and Master Slave setup
Active mq Installation and Master Slave setup
Ramakrishna Narkedamilli
?
ActiveMQ In Action
ActiveMQ In Action
Bruce Snyder
?
Messaging With ActiveMQ
Messaging With ActiveMQ
Bruce Snyder
?
Messaging for IoT
Messaging for IoT
Virtual JBoss User Group
?
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
dejanb
?
Advanced messaging with Apache ActiveMQ
Advanced messaging with Apache ActiveMQ
dejanb
?
Active mq Installation and Master Slave setup
Active mq Installation and Master Slave setup
Ramakrishna Narkedamilli
?
Messaging With ActiveMQ
Messaging With ActiveMQ
Bruce Snyder
?
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
dejanb
?
Advanced messaging with Apache ActiveMQ
Advanced messaging with Apache ActiveMQ
dejanb
?

Active Mq JMS