工业级运维app手机api
沈斌
2017-10-25 f010effc15d322a952dac1fc3653e5533c0b4a18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?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-1.0.xsd "
       default-autowire="byName">
 
    <!-- rabbitMQ配置 -->
    <bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
        <constructor-arg value="101.37.22.173"/>
        <property name="username" value="guest"/>
        <property name="password" value="guest"/>
        <property name="channelCacheSize" value="8"/>
        <property name="port" value="5672"/>
    </bean>
 
    <rabbit:admin connection-factory="rabbitConnectionFactory"/>
 
    <rabbit:queue  name="monitor" durable="false" exclusive="false" auto-delete="false"    />
 
    <!--<bean id="amqpMsgListener" class="com.moral.monitor.listener.MonitorListener"/>-->
 
    <bean id="amqpMsgListener" class="com.moral.monitor.listener.Listener"/>
 
    <rabbit:listener-container connection-factory="rabbitConnectionFactory" acknowledge="auto" >
        <rabbit:listener  queues="monitor"   ref="amqpMsgListener" />
    </rabbit:listener-container>
 
    <bean id="rabbitTemplate" class="org.springframework.amqp.rabbit.core.RabbitTemplate">
        <constructor-arg ref="rabbitConnectionFactory"></constructor-arg>
    </bean>
 
    <rabbit:fanout-exchange name="exchange_alarm" durable="false"  xmlns="http://www.springframework.org/schema/rabbit"></rabbit:fanout-exchange>
</beans>