JMS消息队列之ActiveMQ简单示例
废话不多说,在进入主题前先看一张图,对ActiveMQ有个大体的了解:

<!-- active mq begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.14.5</version>
</dependency>
<!-- active mq end -->
<!-- 配置JMS连接工厂 -->
<amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616"/> <!-- 定义Queue类型的消息目的地 -->
<amq:queue id="queueDestination" physicalName="bounter.queue" /> <!-- 定义Topic类型的消息目的地 -->
<amq:topic id="topicDestination" physicalName="bounter.topic" /> <!-- 定义JmsTemplate,用来简化消息发送 -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="defaultDestinationName" value="bounter.queue"/>
<!--<property name="defaultDestinationName" value="bounter.topic"/>-->
<property name="receiveTimeout" value="10000"/>
</bean>
<!-- 定义接收消息的监听器容器 -->
<jms:listener-container connection-factory="connectionFactory">
<jms:listener destination="bounter.queue" ref="jmsQueueListener" method="onQueueMessage" />
<jms:listener destination="bounter.topic" ref="jmsTopicListener" method="onTopicMessage" />
</jms:listener-container>
JMS消息队列之ActiveMQ简单示例的更多相关文章
- AMQP消息队列之RabbitMQ简单示例
前面一篇文章讲了如何快速搭建一个ActiveMQ的示例程序,ActiveMQ是JMS的实现,那这篇文章就再看下另外一种消息队列AMQP的代表实现RabbitMQ的简单示例吧.在具体讲解之前,先通过一个 ...
- 消息队列之ActiveMQ简单环境搭建
准备: 环境:win7,Eclipse,jdk1.8 ActiveMQ版本:ActiveMQ 5.9.0 Release下载地址:http://activemq.apache.org/download ...
- JMS【三】--ActiveMQ简单的HelloWorld实例
第一篇博文JMS[一]--JMS基本概念,我们介绍了JMS的两种消息模型:点对点和发布订阅模型,以及消息被消费的两个方式:同步和异步,JMS编程模型的对象,最后说了JMS的优点. 第二篇博文JMS[二 ...
- 一、消息队列之ActiveMQ的安装、配置和C#样例代码
最近有时间了,研究一下消息队列ActvieMQ,结合自己的实践和网上的一些大家内容,整理如下,所有步骤和链接均是正确的. 1.ActiveMQ ActiveMQ 是Apache出品,最流行的,能力强劲 ...
- Flume 读取JMS 消息队列消息,并将消息写入HDFS
利用Apache Flume 读取JMS 消息队列消息.并将消息写入HDFS,flume agent配置例如以下: flume-agent.conf #name the components on ...
- 工业物联网或系统集成中应用消息队列(ActiveMQ,C#的demo)的场景全面分析
1.[连载]<C#通讯(串口和网络)框架的设计与实现> 2.[开源]C#跨平台物联网通讯框架ServerSuperIO(SSIO)介绍 2.应用SuperIO(SIO)和开源跨平台物联网框 ...
- java JMS消息队列
http://blog.csdn.net/shirdrn/article/details/6362792 http://haohaoxuexi.iteye.com/blog/1893038 http: ...
- 消息队列之 ActiveMQ(山东数漫江湖)
简介 ActiveMQ 特点 ActiveMQ 是由 Apache 出品的一款开源消息中间件,旨在为应用程序提供高效.可扩展.稳定.安全的企业级消息通信. 它的设计目标是提供标准的.面向消息的.多语言 ...
- 消息队列之 ActiveMQ
简介 ActiveMQ 特点 ActiveMQ 是由 Apache 出品的一款开源消息中间件,旨在为应用程序提供高效.可扩展.稳定.安全的企业级消息通信. 它的设计目标是提供标准的.面向消息的.多语言 ...
随机推荐
- 解析ArcGis的标注(一)——先看看分数式、假分数式标注是怎样实现的
该“标注”系列博文的标注引擎使用“标准标注引擎(standard label engine)”,这个概念如不知道,可不理会,ArcGis默认标注引擎就是它. ArcGis的标注表达式支持VBScrip ...
- 分布式中的 transaction log
分布式中的 transaction log 在分布式系统中,有很多台node组成一个cluster,对于client 的一个写操作请求而言,在什么样的情况下,cluster告诉client此次写操作请 ...
- 使用jedis客户端连接redis,单机版和集群版
单机版 1.入门实例 @Test public void testJedis(){ //创建一个jedis对象,需要指定服务的ip和端口号 Jedis jedis=new Jedis("19 ...
- 向JSP中静态导入HTML文件时,运行jsp时,html中中文产生乱码问题最简单的解决方法
在保证其他的编码格式一致的情况下 在html标签内,head标签外添加一下代码时可以完美解决 亲测 <%@page pageEncoding="UTF-8"%>
- mysql5.7安装(正确安装)实战
一.二进制免编译包安装 参考:http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=10105&highlight=mys ...
- treap基本操作
利用rand保持堆的特性 const int N=; int ls[N],rs[N],v[N],p[N],cnt[N],siz[N]; // 权值 优先级 inline void update(int ...
- Linux 文件删除 提示 Operation not permitted
Linux 删除 隐藏文件提示 Operation not permitted ? linux 删除 隐藏文件 提示 Operation not permitted 不允许操作? 使用 ls ...
- 第21月第4天 leetcode codinginterview c++
1.leetcode Implement strStr(). Returns the index of the first occurrence of needle in haystack, or - ...
- java实现打印前台页面
核心:用window自带方法 window.print(); 打印的范围:body里内容,只要在页面能显示出来,都打印 遇到的问题:打印按钮被一起打印出来了,url也别打印出来了 解决办法:在触发打印 ...
- bzoj3262: 陌上花开(CDQ+树状数组处理三维偏序问题)
题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=3262 题目大意:中文题目 具体思路:CDQ可以处理的问题,一共有三维空间,对于第一维我们 ...