applicationContext-mq.xml 13.3 KB
<?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"
       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.2.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-4.2.xsd
                       http://www.springframework.org/schema/rabbit
                       http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd">

    <context:component-scan base-package="com.yoho.search.consumer.*" />

    <!-- 连接服务配置 -->
    <bean id="connectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
        <property name="username" value="${search.mq.username}"/>
        <property name="password" value="${search.mq.password}"/>
        <property name="addresses" value="${search.mq.server}:${search.mq.port}"/>
        <property name="channelCacheSize" value="60"/>
        <property name="virtualHost" value="${search.mq.virtualHost}"/>
    </bean>

    <rabbit:admin connection-factory="connectionFactory" />

    <!-- queue 队列声明 -->
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_esworddef" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_dynamicrule" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_dynamicruledetails" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_dynamicrulepagerel" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_style" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_brand" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_size" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_storage" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productcolor" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_goods" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_goodsimages" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productstandardrelation" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productstylerelation" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productsort" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_standard" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productindex" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_activityproduct" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productsearch" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productactivitieslink" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_parametermake" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_searchaction" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productkeywords" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productpooldetail" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_robotquestion" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productpriceplan" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_producttiming" />
    
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product_0" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product_1" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product_2" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product_3" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_product_4" />
    
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice_0" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice_1" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice_2" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice_3" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productprice_4" />

    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_helper" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_shops" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_shopsbrands" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_salescategory" />

    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblbrand" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblsite" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblsort" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblproduct" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblproductskc" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_tblproductsku" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productext" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productattributepropertyvalues" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_productattribute" />
    <rabbit:queue durable="true" exclusive="false" name="data_update_channel_suggestconversioncustom" />

    <rabbit:template exchange="${search.mq.exchange}" id="amqpTemplate"
                     connection-factory="connectionFactory" message-converter="jsonMessageConverter" />
    <bean id="jsonMessageConverter" class="com.yoho.search.consumer.common.FastJsonMessageConverter"></bean>

    <bean id="taskExecutor"
          class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="100" />
        <property name="maxPoolSize" value="200" />
        <property name="keepAliveSeconds" value="30000" />
        <property name="queueCapacity" value="3000" />
        <property name="WaitForTasksToCompleteOnShutdown" value="false" />
    </bean>

    <bean id="productMqListener0" class="com.yoho.search.consumer.index.increment.ProductMqListener"></bean>
    <bean id="productMqListener1" class="com.yoho.search.consumer.index.increment.ProductMqListener"></bean>
    <bean id="productMqListener2" class="com.yoho.search.consumer.index.increment.ProductMqListener"></bean>
    <bean id="productMqListener3" class="com.yoho.search.consumer.index.increment.ProductMqListener"></bean>
    <bean id="productMqListener4" class="com.yoho.search.consumer.index.increment.ProductMqListener"></bean>
    
    <bean id="productPriceMqListener0" class="com.yoho.search.consumer.index.increment.ProductPriceMqListener"></bean>
    <bean id="productPriceMqListener1" class="com.yoho.search.consumer.index.increment.ProductPriceMqListener"></bean>
    <bean id="productPriceMqListener2" class="com.yoho.search.consumer.index.increment.ProductPriceMqListener"></bean>
    <bean id="productPriceMqListener3" class="com.yoho.search.consumer.index.increment.ProductPriceMqListener"></bean>
    <bean id="productPriceMqListener4" class="com.yoho.search.consumer.index.increment.ProductPriceMqListener"></bean>

    <rabbit:listener-container connection-factory="connectionFactory" task-executor="taskExecutor" concurrency="1">
        <rabbit:listener queue-names="data_update_channel_esworddef" ref="esWordDefMqListener" />
        <rabbit:listener queue-names="data_update_channel_dynamicrule" ref="dynamicRuleMqListener" />
        <rabbit:listener queue-names="data_update_channel_dynamicruledetails" ref="dynamicRuleDetailsMqListener" />
        <rabbit:listener queue-names="data_update_channel_dynamicrulepagerel" ref="dynamicRulePageRelMqListener" />
        <rabbit:listener queue-names="data_update_channel_style" ref="styleMqListener" />
        <rabbit:listener queue-names="data_update_channel_brand" ref="brandMqListener" />
        <rabbit:listener queue-names="data_update_channel_size" ref="sizeMqListener" />
        <rabbit:listener queue-names="data_update_channel_storage" ref="storageMqListener" />
        <rabbit:listener queue-names="data_update_channel_productcolor" ref="productColorMqListener" />
        <rabbit:listener queue-names="data_update_channel_goods" ref="goodsMqListener" />
        <rabbit:listener queue-names="data_update_channel_goodsimages" ref="goodsImagesMqListener" />
        <rabbit:listener queue-names="data_update_channel_productstandardrelation" ref="productStandardRelationMqListener" />
        <rabbit:listener queue-names="data_update_channel_productstylerelation" ref="productStyleRelationMqListener" />
        <rabbit:listener queue-names="data_update_channel_productsort" ref="productSortMqListener" />
        <rabbit:listener queue-names="data_update_channel_standard" ref="standardMqListener" />
        <rabbit:listener queue-names="data_update_channel_productindex" ref="productIndexMqListener" />
        <rabbit:listener queue-names="data_update_channel_activityproduct" ref="activityProductMqListener" />
        <rabbit:listener queue-names="data_update_channel_productsearch" ref="productSearchMqListener" />
        <rabbit:listener queue-names="data_update_channel_productactivitieslink" ref="productActivitiesLinkMqListener" />
        <rabbit:listener queue-names="data_update_channel_parametermake" ref="parameterMakeMqListener" />
        <rabbit:listener queue-names="data_update_channel_productkeywords" ref="productKeywordsMqListener" />
        <rabbit:listener queue-names="data_update_channel_productpooldetail" ref="productPoolDetailMqListener" />
        <rabbit:listener queue-names="data_update_channel_robotquestion" ref="robotQuestionMqListener" />
        <rabbit:listener queue-names="data_update_channel_productpriceplan" ref="productPricePlanMqListener" />
        <rabbit:listener queue-names="data_update_channel_producttiming" ref="productTimingMqListener" />
        <rabbit:listener queue-names="data_update_channel_shops" ref="shopsMqListener" />
        <rabbit:listener queue-names="data_update_channel_shopsbrands" ref="shopsBrandsMqListener" />
        <rabbit:listener queue-names="data_update_channel_salescategory" ref="salesCategoryMqListener" />
		
        <rabbit:listener queue-names="data_update_channel_product" ref="productMqListener" />
        <rabbit:listener queue-names="data_update_channel_product_0" ref="productMqListener0" />
        <rabbit:listener queue-names="data_update_channel_product_1" ref="productMqListener1" />
        <rabbit:listener queue-names="data_update_channel_product_2" ref="productMqListener2" />
        <rabbit:listener queue-names="data_update_channel_product_3" ref="productMqListener3" />
        <rabbit:listener queue-names="data_update_channel_product_4" ref="productMqListener4" />
        
        <rabbit:listener queue-names="data_update_channel_productprice" ref="productPriceMqListener" />
		<rabbit:listener queue-names="data_update_channel_productprice_0" ref="productPriceMqListener0" />
		<rabbit:listener queue-names="data_update_channel_productprice_1" ref="productPriceMqListener1" />
		<rabbit:listener queue-names="data_update_channel_productprice_2" ref="productPriceMqListener2" />
		<rabbit:listener queue-names="data_update_channel_productprice_3" ref="productPriceMqListener3" />
		<rabbit:listener queue-names="data_update_channel_productprice_4" ref="productPriceMqListener4" />

        <rabbit:listener queue-names="data_update_channel_helper" ref="helperMqListener" />

        <rabbit:listener queue-names="data_update_channel_tblbrand" ref="tblBrandMqListener" />
        <rabbit:listener queue-names="data_update_channel_tblsite" ref="tblSiteMqListener" />
        <rabbit:listener queue-names="data_update_channel_tblsort" ref="tblSortMqListener" />
        <rabbit:listener queue-names="data_update_channel_tblproduct" ref="tblProductMqListener" />
        <rabbit:listener queue-names="data_update_channel_tblproductskc" ref="tblProductSkcMqListener" />
        <rabbit:listener queue-names="data_update_channel_tblproductsku" ref="tblProductSkuMqListener" />
        <rabbit:listener queue-names="data_update_channel_productext" ref="productExtMqListener" />
        <rabbit:listener queue-names="data_update_channel_productattributepropertyvalues" ref="productAttributePropertyValuesMqListener" />
        <rabbit:listener queue-names="data_update_channel_productattribute" ref="productAttributeMqListener" />
        <rabbit:listener queue-names="data_update_channel_suggestconversioncustom" ref="suggestConversionCustomMqListener" />

    </rabbit:listener-container>
</beans>