![e54fab50e026042d20fdfe81cb84c495.gif](https://img-blog.csdnimg.cn/img_convert/e54fab50e026042d20fdfe81cb84c495.gif)
上周说了ActiveMQ入门篇,这周来看看spring以及springBoot如何与activeMQ整合起来。
![f36f6532ae8d380b3b883ace299808cd.png](https://img-blog.csdnimg.cn/img_convert/f36f6532ae8d380b3b883ace299808cd.png)
![01614e22a3ab467aac338db6fc0b1852.gif](https://img-blog.csdnimg.cn/img_convert/01614e22a3ab467aac338db6fc0b1852.gif)
1、需要的依赖:
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-databindartifactId>
<version>2.9.9.3version>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-jmsartifactId>
<version>4.3.23.RELEASEversion>
dependency>
<dependency>
<groupId>org.apache.activemqgroupId>
<artifactId>activemq-poolartifactId>
<version>5.15.9version>
dependency>
2、applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.zhu.study"/>
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory