工业级运维app手机api
沈斌
2017-11-07 15c85cdf12cc7dfc4bac01a66c764ec58c48a465
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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="116.62.12.115"/>
        <property name="username" value="guest"/>
        <property name="password" value="guest_pass"/>
        <property name="channelCacheSize" value="8"/>
        <property name="port" value="5672"/>
    </bean>
 
    <rabbit:admin connection-factory="rabbitConnectionFactory"/>
 
    <bean id="rabbitTemplate" class="org.springframework.amqp.rabbit.core.RabbitTemplate">
        <constructor-arg ref="rabbitConnectionFactory"></constructor-arg>
    </bean>
 
    <rabbit:fanout-exchange name="devices_data" durable="true" auto-delete="false">
        <rabbit:bindings>
            <rabbit:binding queue="devices_storage_data"></rabbit:binding>
        </rabbit:bindings>
    </rabbit:fanout-exchange>
 
    <rabbit:queue name="devices_storage_data" durable="false" auto-delete="true" exclusive="false"/>
 
    <bean id="amqpMsgListener" class="com.moral.monitor.listener.TaskListener"/>
 
    <rabbit:listener-container connection-factory="rabbitConnectionFactory" acknowledge="auto" concurrency="10">
        <rabbit:listener  queues="devices_storage_data" ref="amqpMsgListener" />
    </rabbit:listener-container>
 
    <rabbit:fanout-exchange name="monitors_data2" durable="true" auto-delete="false">
        <!--
        <rabbit:bindings>
            <rabbit:binding queue="monitors_storage_data2"></rabbit:binding>
        </rabbit:bindings>
        -->
    </rabbit:fanout-exchange>
 
    <!--<rabbit:queue name="monitors_storage_data2" durable="false" auto-delete="true" exclusive="false" />-->
 
    <!--http://blog.csdn.net/u012204058/article/details/54292888-->
    <!--http://blog.csdn.net/itmrchen/article/details/53285648-->
 
    <!--<rabbit:queue name="monitors_storage_alarm" durable="true" auto-delete="false" exclusive="false" />-->
 
    <!--<rabbit:fanout-exchange name="monitors_alarm" durable="true" auto-delete="false" />-->
</beans>