mule & seda 学习四

从前,从前

程序跑的太慢,对mule有点误解

jaxb解析xml在高压力下会有互相等待的问题,可能是使用的方式不对

使用mule简单就好了,不要太复杂,任何一个功能最好分成2个stage就好(容易查找内存堵塞)

<mule xmlns="http://www.mulesource.org/schema/mule/core/2.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.mulesource.org/schema/mule/jdbc/2.2" xmlns:xm="http://www.mulesource.org/schema/mule/xml/2.2"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.2" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.2"
xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.2"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/jdbc/2.2 http://www.mulesource.org/schema/mule/jdbc/2.2/mule-jdbc.xsd
http://www.mulesource.org/schema/mule/xml/2.2 http://www.mulesource.org/schema/mule/xml/2.2/mule-xml.xsd
http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
http://www.mulesource.org/schema/mule/cxf/2.2 http://www.mulesource.org/schema/mule/cxf/2.2/mule-cxf.xsd
http://www.mulesource.org/schema/mule/stdio/2.2 http://www.mulesource.org/schema/mule/stdio/2.2/mule-stdio.xsd">

<context:property-placeholder location="classpath:conf/webserviceClientUrl.properties" />
<stdio:connector name="SystemStreamConnectorActive"
promptMessageCode="3" messageDelayTime="1000" />

<spring:beans>
<spring:import resource="classpath:conf/applicationContext.xml" />
</spring:beans>

<configuration>
<default-dispatcher-threading-profile
maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />
<default-receiver-threading-profile
maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />
<default-service-threading-profile
maxThreadsActive="50" maxThreadsIdle="25" threadWaitTimeout="1000" threadTTL="60000" />
</configuration>

<jdbc:connector name="jdbcConnectorActive" pollingFrequency="1000" dataSource-ref="dataSource">

<!-- 激活 -->
<jdbc:query key="orderQry"
value="select /*+ FULL(c) */
c.cust_order_id
from customer_order c
where exists (select b.cust_order_id
from order_item b
where b.order_item_cd = 'T20'
and b.status = '1501'
and b.cust_order_id = c.cust_order_id)
and c.status = '040'
and rownum between 0 and 100" />
<jdbc:query key="orderQry.ack"
value="update CUSTOMER_ORDER set STATUS='110' where CUST_ORDER_ID = #[map-payload:CUST_ORDER_ID] " />

<!-- 竣工 -->
<jdbc:query key="orderCompletionQry"
value="select a.cust_order_id from customer_order a where a.status = '120' and rownum between 0 and 100" />
<jdbc:query key="orderCompletionQry.ack"
value="update CUSTOMER_ORDER set STATUS='899' where CUST_ORDER_ID = #[map-payload:CUST_ORDER_ID] " />

</jdbc:connector>

<model name="jdbcInboundActionModel">
<!-- 集团改造 -->
<!-- 激活流程 start -->
<service name="jdbcService">
<inbound>
<jdbc:inbound-endpoint queryKey="orderQry" />
</inbound>
<component class="com.tydic.mule.component.OrderProcessComponent" />
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://activeXML" />
</pass-through-router>
</outbound>
</service>

<!-- 废弃的组件
<service name="creatXMLService">
<inbound>
<vm:inbound-endpoint address="vm://orders" />
</inbound>
<component class="com.tydic.mule.component.ActiveXMLBuilderComponent" />
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://activeXML" />
</pass-through-router>
</outbound>
<threading-profile maxThreadsActive="200" maxThreadsIdle="100" threadWaitTimeout="400" threadTTL="6000000" poolExhaustedAction="RUN"></threading-profile>
</service>
-->

<service name="sendXMLService">
<inbound>
<vm:inbound-endpoint address="vm://activeXML" />
</inbound>
<component class="com.tydic.mule.component.ActiveXMLSendComponent" />
</service>
<!-- 激活流程 end -->

<!-- 竣工流程 start -->
<service name="jdbcCompletionService">
<inbound>
<jdbc:inbound-endpoint queryKey="orderCompletionQry" />
</inbound>
<component class="com.tydic.mule.component.OrderCompletionComponent" />
</service>
<!-- 竣工流程 end -->

</model>
</mule>

猜你喜欢

转载自hamlzf.iteye.com/blog/1231578
今日推荐