|
|
@@ -1,56 +0,0 @@
|
|
|
-<?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:rabbit="http://www.springframework.org/schema/rabbit"
|
|
|
- xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
|
- http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
|
|
- http://www.springframework.org/schema/rabbit
|
|
|
- http://www.springframework.org/schema/rabbit/spring-rabbit.xsd">
|
|
|
-
|
|
|
- <!--配置connection-factory,指定连接rabbit server参数 -->
|
|
|
- <bean id="rabbitConnectionFactory"
|
|
|
- class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
|
|
|
- <constructor-arg value="${rabbitmq.host}"/>
|
|
|
- <property name="username" value="${rabbitmq.username}"/>
|
|
|
- <property name="password" value="${rabbitmq.password}"/>
|
|
|
- <!--<property name="channelCacheSize" value="${rabbit.channelCacheSize}"/>-->
|
|
|
- <property name="port" value="${rabbitmq.port}"/>
|
|
|
- <property name="virtualHost" value="${rabbitmq.virtual-host}"/>
|
|
|
- </bean>
|
|
|
- <rabbit:admin connection-factory="rabbitConnectionFactory"/>
|
|
|
-
|
|
|
- <!-- autoDelete:是否自动删除 durable:持久化 -->
|
|
|
- <rabbit:queue name="test_liam_queue" durable="true"/>
|
|
|
- <!--<rabbit:queue name="${rabbit.queue}" durable="true"/>-->
|
|
|
- <!-- topic主题 -->
|
|
|
- <rabbit:topic-exchange name="test.liam.topic.exchange" xmlns="http://www.springframework.org/schema/rabbit" durable="true">
|
|
|
- <bindings>
|
|
|
- <binding queue="test_liam_queue" pattern="*.liam.queue" />
|
|
|
- </bindings>
|
|
|
- </rabbit:topic-exchange>
|
|
|
- <!-- 绑定交换机和队列 -->
|
|
|
- <!-- <rabbit:direct-exchange name="${rabbit.exchange}" xmlns="http://www.springframework.org/schema/rabbit" durable="true" >
|
|
|
- <rabbit:bindings>
|
|
|
- <rabbit:binding queue="${rabbit.queue}" key="${rabbit.routingKey}" />
|
|
|
- </rabbit:bindings>
|
|
|
- </rabbit:direct-exchange>-->
|
|
|
-
|
|
|
- <!-- 创建rabbitTemplate 消息模板类 -->
|
|
|
- <bean id="rabbitTemplate" class="org.springframework.amqp.rabbit.core.RabbitTemplate">
|
|
|
- <constructor-arg ref="rabbitConnectionFactory"/>
|
|
|
- <!--消息确认回调 -->
|
|
|
- <property name="confirmCallback" ref="producer"/>
|
|
|
- </bean>
|
|
|
-
|
|
|
- <bean name="producer" class="com.uas.platform.b2b.support.mq.RabbitSendService"/>
|
|
|
-
|
|
|
- <bean id="messageContainer" class="org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer">
|
|
|
- <!--<property name="queues" ref="${rabbit.queue}"/>-->
|
|
|
- <property name="exposeListenerChannel" value="true"/>
|
|
|
- <property name="maxConcurrentConsumers" value="10"/>
|
|
|
- <property name="concurrentConsumers" value="2"/>
|
|
|
- <property name="connectionFactory" ref="rabbitConnectionFactory"/>
|
|
|
- <property name="acknowledgeMode" value="MANUAL"/>
|
|
|
- </bean>
|
|
|
-
|
|
|
-</beans>
|