Mule的JDBC应用1

来源:互联网 发布:电信100兆宽带网络测试 编辑:程序博客网 时间:2024/05/04 00:01
  1. <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"  
  2.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans"  
  3.     xmlns:context="http://www.springframework.org/schema/context"  
  4.     xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.2" xmlns:xm="http://www.mulesource.org/schema/mule/xml/2.2"  
  5.     xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"  
  6.     xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.2"  
  7.     xsi:schemaLocation="   
  8.        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
  9.        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd  
  10.        http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd  
  11.        http://www.mulesource.org/schema/mule/jdbc/2.2 http://www.mulesource.org/schema/mule/jdbc/2.2/mule-jdbc.xsd  
  12.        http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd  
  13.        http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd  
  14.        http://www.mulesource.org/schema/mule/cxf/2.2 http://www.mulesource.org/schema/mule/cxf/2.2/mule-cxf.xsd  
  15.        http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd">  
  16.   
  17.     <context:property-placeholder location="classpath:conf/webserviceClientUrl.properties" />   
  18.     <stdio:connector name="SystemStreamConnectorActive"  
  19.         promptMessageCode="3" messageDelayTime="1000" />   
  20.   
  21.     <spring:beans>   
  22.         <spring:import resource="classpath:conf/applicationContext.xml" />   
  23.     </spring:beans>   
  24.   
  25.     <configuration>   
  26.         <default-dispatcher-threading-profile   
  27.             maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />   
  28.         <default-receiver-threading-profile   
  29.             maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />   
  30.         <default-service-threading-profile   
  31.             maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />               
  32.     </configuration>   
  33.   
  34.     <jdbc:connector name="jdbcConnectorActive" pollingFrequency="1200" dataSource-ref="dataSource">   
  35.        
  36.         <!-- 激活 -->       
  37.         <jdbc:query key="orderQry"  
  38.             value="select /*+index(c IDX_VSOP_CUST_ORDER_STATUS)*/ c.cust_order_id   
  39.                   from customer_order c   
  40.                  where exists (select /*+index(b IDX_ORDER_ITEM_STATUS)*/ b.cust_order_id   
  41.                           from order_item b   
  42.                          where b.order_item_cd = 'T20'  
  43.                            and b.status = '1501'  
  44.                            and b.cust_order_id = c.cust_order_id)   
  45.                    and c.status = '040'  
  46.                    and rownum between 0 and 100" />   
  47.         <jdbc:query key="orderQry.ack"  
  48.             value="update CUSTOMER_ORDER set STATUS='110'  where CUST_ORDER_ID = #[map-payload:CUST_ORDER_ID] " />   
  49.                
  50.         <!-- 竣工 -->   
  51.         <jdbc:query key="orderCompletionQry"  
  52.             value="select a.cust_order_id from customer_order a where a.status = '120' and rownum between 0 and 100" />   
  53.         <jdbc:query key="orderCompletionQry.ack"  
  54.             value="update CUSTOMER_ORDER set STATUS='899'  where CUST_ORDER_ID = #[map-payload:CUST_ORDER_ID] " />   
  55.            
  56.         <!-- 用户状态同步下发 -->       
  57.         <jdbc:query key="userInfoSynQry"  
  58.             value="select a.user_info_syn_id,   
  59.                        a.system_id,   
  60.                        a.action_type,   
  61.                        a.prod_spec_code,   
  62.                        a.product_no,   
  63.                        a.old_product_no,   
  64.                        a.user_state,   
  65.                        a.user_pay_type,   
  66.                        a.state   
  67.                   from user_info_syn a where a.state = '100'  
  68.                    and rownum between 0 and 100" />   
  69.         <jdbc:query key="userInfoSynQry.ack"  
  70.             value="update user_info_syn t set t.state = '200' where t.user_info_syn_id = #[map-payload:user_info_syn_id] " />   
  71.                
  72.         <!-- 服开回单 -->   
  73.         <jdbc:query key="pfOrderQry"  
  74.             value="SELECT T.WORK_ORDER_ID workOrderId,   
  75.                      T.CUST_ORDER_ID custOrderId,   
  76.                      T.STATE state,   
  77.                      T.ADD_TIME addTime,   
  78.                      T.REMARK remark,   
  79.                      T.ORDER_STATE orderState   
  80.                 FROM RETURN_WORK_ORDER T   
  81.                WHERE T.STATE='0' and rownum between 0 and 100" />   
  82.          <jdbc:query key="pfOrderQry.ack"  
  83.             value="update RETURN_WORK_ORDER set STATE='9' where CUST_ORDER_ID = #[map-payload:custOrderId] "/>   
  84.     </jdbc:connector>   
  85.   
  86.     <endpoint name="CustomerOrderItemRequests" address="vm://customerOrderitem.requests" />   
  87.     <vm:connector name="vmConnector" queueEvents="true" />   
  88.   
  89.     <model name="jdbcInboundActionModel">   
  90.     <!-- 集团改造 -->   
  91.     <!-- 激活流程    start -->   
  92.       <service name="jdbcService">   
  93.             <inbound>   
  94.                 <jdbc:inbound-endpoint queryKey="orderQry" />   
  95.             </inbound>   
  96.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  97.             <pooled-component class="com.tydic.mule.component.OrderProcessComponent">   
  98.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  99.             maxActive="100" maxIdle="200" maxWait="300" />   
  100.             </pooled-component>   
  101.             <outbound>   
  102.                 <pass-through-router>   
  103.                     <vm:outbound-endpoint address="vm://orders" />   
  104.                 </pass-through-router>   
  105.             </outbound>   
  106.         </service>   
  107.            
  108.         <service name="creatXMLService">   
  109.                <inbound>   
  110.                 <vm:inbound-endpoint address="vm://orders" />   
  111.             </inbound>   
  112.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  113.             <pooled-component class="com.tydic.mule.component.ActiveXMLBuilderComponent">   
  114.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  115.             maxActive="600" maxIdle="700" maxWait="800" />   
  116.             </pooled-component>   
  117.             <outbound>   
  118.                 <pass-through-router>   
  119.                     <vm:outbound-endpoint address="vm://activeXML" />   
  120.                 </pass-through-router>   
  121.             </outbound>   
  122.             <threading-profile maxThreadsActive="300" maxThreadsIdle="200" threadWaitTimeout="1000" threadTTL="60000" poolExhaustedAction="RUN"></threading-profile>   
  123.         </service>   
  124.         
  125.         <service name="sendXMLService">   
  126.                <inbound>   
  127.                 <vm:inbound-endpoint address="vm://activeXML" />   
  128.             </inbound>   
  129.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  130.             <pooled-component class="com.tydic.mule.component.ActiveXMLSendComponent">   
  131.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  132.             maxActive="600" maxIdle="700" maxWait="800" />   
  133.             </pooled-component>   
  134.             <threading-profile maxThreadsActive="300" maxThreadsIdle="200" threadWaitTimeout="1000" threadTTL="60000"></threading-profile>   
  135.         </service>   
  136.     <!-- 激活流程    end -->       
  137.            
  138.     <!-- 竣工流程    start -->             
  139.     <service name="jdbcCompletionService">   
  140.             <inbound>   
  141.                 <jdbc:inbound-endpoint queryKey="orderCompletionQry" />   
  142.             </inbound>   
  143.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  144.             <pooled-component class="com.tydic.mule.component.OrderCompletionComponent">   
  145.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  146.             maxActive="100" maxIdle="200" maxWait="300" />   
  147.             </pooled-component>   
  148.     </service>   
  149.     <!-- 竣工流程    end -->           
  150.        
  151.        
  152.     <!-- 用户状态同步下发 -->   
  153.     <service name="jdbcUserInfoSynService">   
  154.             <inbound>   
  155.                 <jdbc:inbound-endpoint queryKey="userInfoSynQry" />   
  156.             </inbound>   
  157.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  158.             <pooled-component class="com.tydic.mule.component.UserInfoSynXMLBuilderComponent">   
  159.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  160.             maxActive="600" maxIdle="700" maxWait="800" />   
  161.             </pooled-component>   
  162.             <outbound>   
  163.                 <pass-through-router>   
  164.                     <vm:outbound-endpoint address="vm://userInfoSynXML" />   
  165.                 </pass-through-router>   
  166.             </outbound>   
  167.             <threading-profile maxThreadsActive="200" maxThreadsIdle="100" threadWaitTimeout="1000" threadTTL="60000" poolExhaustedAction="RUN"></threading-profile>   
  168.     </service>   
  169.   
  170.     <service name="userInfoSynSendXMLService">   
  171.                <inbound>   
  172.                 <vm:inbound-endpoint address="vm://userInfoSynXML" />   
  173.             </inbound>   
  174.             <!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->   
  175.             <pooled-component class="com.tydic.mule.component.UserInfoSynXMLSendComponent">   
  176.             <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"  
  177.             maxActive="200" maxIdle="300" maxWait="400" />   
  178.             </pooled-component>   
  179.     </service>   
  180.     <!-- 用户状态同步下发     end-->   
  181.   
  182.   
  183.     <!-- 服开回单服务 -->   
  184.     <service name="jdbcInboundPFReturnService">   
  185.         <inbound>   
  186.             <jdbc:inbound-endpoint queryKey="pfOrderQry" />   
  187.         </inbound>   
  188.         <pooled-component class="com.tydic.mule.component.PFReturnXMLBuilderComponent">   
  189.         <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"    
  190.         maxActive="600" maxIdle="700" maxWait="800" />   
  191.         </pooled-component>   
  192.         <outbound>   
  193.              <pass-through-router>   
  194.                  <vm:outbound-endpoint address="vm://pfReturnXMLOrders" />   
  195.              </pass-through-router>   
  196.          </outbound>   
  197.          <threading-profile maxThreadsActive="150" maxThreadsIdle="75" threadWaitTimeout="1000" threadTTL="60000" poolExhaustedAction="RUN"></threading-profile>      
  198.     </service>   
  199.   
  200.     <service name="pfReturnSendXMLService">   
  201.         <inbound>   
  202.             <vm:inbound-endpoint address="vm://pfReturnXMLOrders" />   
  203.         </inbound>   
  204.         <pooled-component class="com.tydic.mule.component.PFReturnXMLSendComponent">   
  205.         <pooling-profile exhaustedAction="WHEN_EXHAUSTED_WAIT" initialisationPolicy="INITIALISE_ALL"    
  206.         maxActive="600" maxIdle="700" maxWait="800" />   
  207.         </pooled-component>   
  208.         <threading-profile maxThreadsActive="200" maxThreadsIdle="100" threadWaitTimeout="1000" threadTTL="60000" poolExhaustedAction="RUN"></threading-profile>   
  209.     </service>   
  210.     <!-- 服开回单服务    end -->   
  211.        
  212.     <!--    
  213.         <service name="jdbcInboundActionService">   
  214.             <inbound>   
  215.                 <jdbc:inbound-endpoint queryKey="orderQry" />   
  216.             </inbound>   
  217.             <component class="com.muleinaction.MuleDataServiceComponent" />   
  218.             <outbound>   
  219.                 <pass-through-router>   
  220.                     <vm:outbound-endpoint address="vm://orders" />   
  221.                 </pass-through-router>   
  222.             </outbound>   
  223.         </service>   
  224.         <service name="ThreeWebService">   
  225.             <inbound>   
  226.                 <vm:inbound-endpoint address="vm://orders" />   
  227.             </inbound>   
  228.             <component class="com.muleinaction.ThreeWebServiceComponent" />   
  229.         </service>   
  230.         <service name="ClientWebService">   
  231.             <inbound>   
  232.                 <vm:inbound-endpoint ref="CustomerOrderItemRequests" />   
  233.             </inbound>   
  234.             <component class="com.muleinaction.ClientCXFWebServiceComponent">   
  235.             </component>   
  236.         </service>   
  237.      -->   
  238.     </model>   
  239. </mule>
原创粉丝点击