ActiveMQ可以和spring很好的集成,下面我们来看看,如何做个集成的demo。

  (1)pom.xml引入相关jar

<!-- spring相关 begin -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.5.RELEASE</version>
</dependency>
<!-- spring相关 end -->
<!-- activeMQ相关 begin-->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.11.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<!-- activeMQ相关 end-->

  (2)添加生产者配置activemq-sender.xml

<description>JMS发布者应用配置</description>

    <!-- CachingConnectionFactory 连接工厂 (有缓存功能)-->
<bean id="cachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<!-- Session缓存数量 -->
<property name="sessionCacheSize" value="20" />
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<!-- MQ地址 账户名 密码-->
<property name="brokerURL" value="tcp://192.168.56.129:61616" />
<property name="userName" value="parry" />
<property name="password" value="parry123" />
<!-- 是否异步发送 -->
<property name="useAsyncSend" value="true"/>
</bean>
</property>
</bean> <!-- 接收消息的目的地(一个主题)点对点队列 -->
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
<!-- 设置消息主题的名字 -->
<constructor-arg index="0" value="messages" />
</bean> <!-- 接收配置JMS模版 -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="cachingConnectionFactory" />
<property name="defaultDestination" ref="destination" />
<!-- value为true为发布/订阅模式; value为false为点对点模式-->
<property name="pubSubDomain" value="false"/>
</bean>

  (3)添加消费者配置activemq-consumer.xml

<description>JMS订阅者应用配置</description>
<!-- CachingConnectionFactory 连接工厂 (有缓存功能)-->
<bean id="cachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<!-- Session缓存数量 -->
<property name="sessionCacheSize" value="20" />
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<!-- MQ地址 账户名 密码-->
<property name="brokerURL" value="tcp://192.168.56.129:61616" />
<property name="userName" value="parry" />
<property name="password" value="parry123" />
<!-- 是否异步发送 -->
<property name="useAsyncSend" value="true"/>
</bean>
</property>
</bean> <!-- 接收消息的目的地(一个主题)点对点队列 -->
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
<!-- 设置消息主题的名字 -->
<constructor-arg index="0" value="messages" />
</bean> <!-- 消费者配置 (自己定义) -->
<bean id="consumer" class="com.parry.MQ.funcion.Listener" /> <!-- 消息监听容器 -->
<bean id="myListenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="cachingConnectionFactory" />
<property name="destination" ref="destination" />
<property name="messageListener" ref="consumer" />
<!-- 如果消息的接收速率,大于消息处理的速率时,可以采取线程池方式 -->
<property name="taskExecutor" ref="queueMessageExecutor"/>
<!-- 设置固定的线程数 -->
<property name="concurrentConsumers" value="30"/>
<!-- 设置动态的线程数 -->
<property name="concurrency" value="20-50"/>
<!-- 设置最大的线程数 -->
<property name="maxConcurrentConsumers" value="80"/>
</bean>
<bean id="queueMessageExecutor"
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="30" />
<property name="maxPoolSize" value="80" />
<property name="daemon" value="true" />
<property name="keepAliveSeconds" value="120" />
</bean>

  (4)新建一个发送消息的方法

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Component;
/**
* 发送消息
* @author Administrator
*
*/
@Component
public class QueueSender { @Autowired
private JmsTemplate myJmsTemplate; /**
* 发送一条消息到指定的队列(目标)
*
* @param queueName
* 队列名称
* @param message
* 消息内容
*/
public void send(String queueName, final String message) {
myJmsTemplate.send(queueName, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
return session.createTextMessage(message);
}
});
}
}

  (5)添加监听器

package com.parry.MQ.funcion;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage; /**
* 接收者监听类
* @author Administrator
*
*/
public class Listener implements MessageListener { public void onMessage(Message message) {
// 业务处理
try {
TextMessage message2 = (TextMessage) message;
System.out.println("接收到信息:" + message2.getText());
} catch (JMSException e) {
e.printStackTrace();
}
}
}

  (6)写个一请求测试一下

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import com.parry.MQ.funcion.QueueSender; @Controller
public class App { @Autowired
private QueueSender sender; @RequestMapping("test")
@ResponseBody
public String Test() { sender.send("messages", "你好,这是我的第一条消息!");
return "Hello world";
}
}

  (7)测试结果

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4cAAABNCAIAAACaFIaOAAAT8UlEQVR4nO2d2bXjKhBFHZcDUjyORsk4GPpDHhiqDgXytdz23uutt/paoijmI0DilB4sp3Qq/1tW+2r++7qoUHlw8/ft0vlS/3g5p9MpFSHWdDql0zld8z8Xx/g1ne8/LpbD693C80pmULHW6b1cDc/N3BCXPJamFKpQuU3hyeNSVcqtC0bOpyavYpdeXqPEJRGXyMNu7V2sH6+X5/3nS7qcXTfWWKjqalVeogLoGmU638l5p/6rjHpjBaiMR7sU38MqA09NX2Tk4TWdm3Q98020lFT0S8XPom5kHc7laqTaLOWJfuN6ufWumzNVDymK8hEwrVn/HHDDqwDJbw4iVCfJTs6LdAXroYETl3BeND03Elle03HNDVITfW9KMxmVX40WB/xnnPYFb7rgZwsJI0YXeDlzuX05G08O3UsziBr1isoWjWuW76zMMqPeVwHCtNr9lR5K/jqu76xgH8gfdA4AEGCfK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Roli6uanTo7phnY4GKr93csQAAAA+AU6yiZZssZTe9XVNsiQQjI1nClcrpfz6XRqj1z2ohMKL+hbEDNe/UuSuWTqVG3tJXg5793sBddFiSoFAAD4ZTr7SiMSs7pkKo/q/+J+0xnPyQ1TlVZRR1IkIhVUnoskaFkmpFublmRpOF0K7f3x1Ik/I6nz4jXzZ9RDAAAA+A4mV/DbX2q7clU3Ij72SKtWw0WcDDomYhSxT5gSDpu3mTF6IjLihhagcW+DRYkqBQAA+GWULPBU3ZAiyf80A3oyxRMoceGilbF2wxNh3bi8PzXCbeFnFUQnJw8y5I+ZIvMGEV0k0wAAAOCXqWVK8uVFfvURKjU6T4fNA3Y8G9FMngXTT+GMJ8gimqz6twiirXmZ1v13PEVBhoqg/TH3Z2dRAgAAwNfjzvC1EqdSS20Qz1TyZVNQpmj5EnzbyYx9LjniBmHNS3V1T8SC6VJEBU4LQRHwkY2RuLQddCoAAMDPomRT+6P5j7j4EKbaP7WUzNGqVFsQDugfdVxmWJGEZIn+thSCqlS4NCr74kWmVXLQFKoUAADgZ1GSRU93dRVSO2Fm6hJvdk2IqqB26QqySELiEemw+T3xO9uAZl61zkd0fxcvZyL63ktCdRUZCgAAABuFqqikT/V7e2f1YxvWCzU08dZKsQlVaqbCdD5iWceiHfbu8fxMZdF0U9caFJaH0uVdNX+JpN20AwAAAL8JmgAAAAAAjgdVCgAAAADHgyoFAAAAgONBlQIAAADA8aBKAQAAAOB4UKUAAAAAcDyoUgAAAAA4HlQpAAAAABwPqhQAAAAAjgdVCgAAAADHgyoFAAAAgONBlQIAAADA8aBKAQAAAOB4UKUAAAAAcDyoUgAAAAA4HlQpAAAAABwPqhQAAAAAjucfUYr3YgMxcYwAAAAASUVORK5CYII=" alt="" />

  在ActiveMQ的管理后台,我们也能看到我们的消息(这里我多测试了几次):

  aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+oAAABACAIAAAACkxqQAAASMklEQVR4nO2d/28b533H9Tfxt6ISv4Kk6v7Qz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wwxp7n/i93xif/+zXGWHH548ykNzPpzZzybjVXfJlT3swpb2bSm5n0ZSa9W811b+aU7ttT3sykbl35atKXOeVrnq25xfv4J99OT/pEia3voJdRA/bdLi5JEzgLykZcoB01oAhNuLpsX4oq7z+q3/5R7Z/fVZ7DWJgOFq8f2/n47zOT3kzyr3OpsSfxH2ye9G6e8G6eHNk6oax4t06ObJ7wbp4Y2Twxsqmub51UP570bp7wbp0c2Trp3VSWE96tkyObJ7V9vFsnmts3T4ysv/Ot9Pt+UWLrO+hl1IB9t4tL0gTOgrIRF2hHDShCE64umTuJ+s3D2vuPFH+cTwRyZ3yZSe+T90bS48OPf/Lt9Xe+9eTdEeMy3LblhRbz4VvvR/Mrd0WJre+gl1ED9t0uLkkTOAvKRlygHTWgCE24uhRzm5k7ifxsZHs2kv95ODcdyiaDmURw68PA5hn/xml/+pQvPelLv+/fmBjZOD68MTG8MTGcnhhRVjYmRjaOj2xMjKSPj2y0Ng4re6bVlY3jw+q3I60t2iHHhzcmhvMrd0ulkiix9R30MmrAvtvFJWkCZ0HZiAu0owYUoQl0GSSgJjVg3+3ikjSBs6BsxAXaUQOK0AS6DBJQkxqw73ZxSZrAWVA24gLtqAFFaAJdBgmoSQ3Yd7u4JE3gLCgbcYF21IAiNIEugwTUpAbsu11ckiZwFpSNuEA7akARmkCXQQJqUgP23S4uSRM4C8pGXKAdNaAITaDLIAE1qdG7D/9/GVoCvfMF7o8AAAAASUVORK5CYII=" alt="" />

ActiveMQ与spring集成实现Queue模式的更多相关文章

  1. ActiveMQ之spring集成消息转换器MessageConverter

    MessageConverter的作用主要有两方面,一方面它可以把我们的非标准化Message对象转换成我们的目标Message对象,这主要是用在发送消息的时候:另一方面它又可以把我们的Message ...

  2. 从零开始学 Java - Spring 集成 ActiveMQ 配置(一)

    你家小区下面有没有快递柜 近两年来,我们收取快递的方式好像变了,变得我们其实并不需要见到快递小哥也能拿到自己的快递了.对,我说的就是类似快递柜.菜鸟驿站这类的代收点的出现,把我们原来快递小哥必须拿着快 ...

  3. 从零开始学 Java - Spring 集成 ActiveMQ 配置(二)

    从上一篇开始说起 上一篇从零开始学 Java - Spring 集成 ActiveMQ 配置(一)文章中讲了我关于消息队列的思考过程,现在这一篇会讲到 ActivMQ 与 Spring 框架的整合配置 ...

  4. Spring集成ActiveMQ配置 --转

    转自:http://suhuanzheng7784877.iteye.com/blog/969865 集成环境 Spring采用2.5.6版本,ActiveMQ使用的是5.4.2,从apache站点可 ...

  5. Spring集成Redis方案(spring-data-redis)(基于Jedis的单机模式)(待实践)

    说明:请注意Spring Data Redis的版本以及Spring的版本!最新版本的Spring Data Redis已经去除Jedis的依赖包,需要自行引入,这个是个坑点.并且会与一些低版本的Sp ...

  6. ActiveMQ学习笔记(6)----ActiveMQ整合Spring开发

    1. 添加依赖 spring 提供了对JMS的支持,需要添加Spring支持jms的包和Spring的核心包,如下: <dependency> <groupId>org.apa ...

  7. rabbitMQ第五篇:Spring集成RabbitMQ

    前面几篇讲解了如何使用rabbitMq,这一篇主要讲解spring集成rabbitmq. 首先引入配置文件org.springframework.amqp,如下 <dependency> ...

  8. RabbitMQ安装和使用(和Spring集成)

    一.安装Rabbit MQ Rabbit MQ 是建立在强大的Erlang OTP平台上,因此安装Rabbit MQ的前提是安装Erlang.通过下面两个连接下载安装3.2.3 版本: 下载并安装 E ...

  9. Spring集成RabbitMQ-使用RabbitMQ更方便

    如果提到Spring,你脑海中对他的印象还停留在SSH三大框架之一,那或许你该好好重新认识这个家伙. 在IT技术日新月异的今天,他还能让你忘不了并与他朝夕相处,他,肯定有自己的绝活.如今他早已经不是孤 ...

随机推荐

  1. WPF入门:数据绑定

    上一篇我们将XAML大概做了个了解 ,这篇将继续学习WPF数据绑定的相关内容 数据源与控件的Binding Binding作为数据传送UI的通道,通过INotityPropertyChanged接口的 ...

  2. C#开发微信门户及应用(24)-微信小店货架信息管理

    在前面微信小店系列篇<C#开发微信门户及应用(22)-微信小店的开发和使用>里面介绍了一些微信小店的基础知识,以及<C#开发微信门户及应用(23)-微信小店商品管理接口的封装和测试& ...

  3. Debug JDK变量显形

    本文面向的朋友 本文主要说明在使用Eclipse Debug JDK时,看不到变量值的解决办法. 如果您看到上面绿色字体表示不敢兴趣,请一定果断back,如果您不爽,请在下面使劲的拍. Debug J ...

  4. 类型转换和类型相关函数.png

  5. 伙伴们休息啦canvas绘图夜空小屋

    HTML5 canvas绘图夜空小屋 伙伴们园友们,夜深了,休息啦,好人好梦... 查看效果:http://hovertree.com/texiao/html5/28/ 效果图如下: 代码如下: &l ...

  6. Database first with EntityFramework (Migration)安装和升级

    最近看了国外几个项目,发现用EntityFramework做Code First的项目现在很流行. 最让我有兴趣的一个功能则是,EntityFramework对于数据库的安装和升级的无缝完美支持,且很 ...

  7. Oracle ORA-07445 evaopn2()+128错误问题

    Oracle ORA-07445 evaopn2()+128错误问题 问题描述 Plsql developer执行一段sql报错: 经查alert log详细报错信息为: ORA-07445: exc ...

  8. Oracle行转列、列转行的Sql语句总结

    多行转字符串 这个比较简单,用||或concat函数可以实现  SQL Code  12    select concat(id,username) str from app_userselect i ...

  9. Java开发代码性能优化总结

    代码优化,可能说起来一些人觉得没用.可是我觉得应该平时开发过程中,就尽量要求自己,养成良好习惯,一个个小的优化点,积攒起来绝对是有大幅度效率提升的.好了,将平时看到用到总结的分享给大家. 代码优化的目 ...

  10. redis主从

    安装: tar -zxvf redis-3.2.6.tar.gz cd redis-3.2.6make make installcd utils/ sh install_server.sh 主: 配置 ...