【参考】spring整合activemq
来源:互联网 发布:数据字典下载 编辑:程序博客网 时间:2024/05/18 03:06
activemq的pom依赖:
<dependency><groupId>org.apache.activemq</groupId><artifactId>activemq-all</artifactId></dependency><dependency><groupId>org.apache.activemq</groupId><artifactId>activemq-pool</artifactId></dependency>
</pre><pre code_snippet_id="1658506" snippet_file_name="blog_20160423_4_1122630" name="code" class="java">消息提供方:
<!-- 配置 Spring管理MQ 连接ActiveMQ --><!-- 连接工厂 此工厂由Apache 提供 --><bean id="activeMQConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"><!-- 连接地址 --><property name="brokerURL" value="tcp://192.168.200.128:61616"/><!-- 用户名及密码 --><property name="userName" value="admin"/><property name="password" value="admin"/></bean><!-- 连接池管理 连接工厂 由Apache提供--><bean id="pooledConnectionFactoryBean" class="org.apache.activemq.pool.PooledConnectionFactoryBean"><!-- 注入工厂 --><property name="connectionFactory" ref="activeMQConnectionFactory"/><!-- 最大连接数 --><property name="maxConnections" value="2"/></bean><!-- 把上面的工厂交由Spring管理 工厂--><bean id="singleConnectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory"><!-- 注入上面的工厂 --><property name="targetConnectionFactory" ref="pooledConnectionFactoryBean"/></bean><!-- 使用Spring提供 的jmsTemplate 来操作ActiveMQ --><bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"><!-- 注入Spring单例工厂 --><property name="connectionFactory" ref="singleConnectionFactory"/><!-- 设置一个默认的操作的目标 --><property name="defaultDestinationName" value="pId"/></bean></beans>
消息消费方:
保存商品信息:
商品上架更新solr索引:
0 0
- 【参考】spring整合activemq
- ActiveMQ(四):Spring ActiveMQ 整合
- ActiveMQ和spring整合
- Spring整合ActiveMQ
- SPRING+ACTIVEMQ+TOMCAT整合
- Spring整合activeMQ
- ActiveMQ、Spring整合学习
- activeMq整合spring
- ActiveMQ、Spring整合学习
- spring activemq quartz 整合
- SPRING JMS 整合ACTIVEMQ
- ActiveMQ整合Spring
- Spring整合ActiveMQ
- spring+activemq整合学习
- spring 整合 activemq 配置文件
- Spring整合ActiveMQ
- Spring与ActiveMQ整合
- ActiveMQ和spring整合
- [Contest] Sdoi2016 题目汇总
- vagrant up and authentication failure
- 114.Reverse String
- {Less} is more, than Css
- iOS学习笔记41-Swift(一)基础部分
- 【参考】spring整合activemq
- poj-2718-Smallest Difference
- python基础一
- 对三个超市销量、品牌数、均价聚类
- poj 3275 Ranking the Cows 传递闭包+邻接表优化
- ubuntu chrome
- ubuntu14.04下安装32位库,ia32-libs
- field requires API 19(current min is 18) java.nio.charset.standardcharsets#UTF_8
- 图论基础