`
isiqi
  • 浏览: 16041047 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

mule & seda的学习三

阅读更多

以竣工服务为例

package com.tydic.mule.component;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import com.tydic.framework.utils.spring.SpringContextUtils;
public class OrderCompletionComponent {

public SqlMapClientTemplate ibatisTemplate = (SqlMapClientTemplate) SpringContextUtils
.getBean("sqlMapClientTemplate");

// <jdbc:inbound-endpoint queryKey="orderCompletionQry" />
@SuppressWarnings("unchecked")
public Object process(Object vm) throws Exception {
Long start = System.currentTimeMillis();
Map<String, Object> map = (Map<String, Object>) vm;
BigDecimal cust_order_id = (BigDecimal) map.get("cust_order_id");
Map<String,Object> paraMap = new HashMap<String,Object>();
paraMap.put("cust_order_id", cust_order_id);
paraMap.put("status", "900");
paraMap.put("state", "2002");
ibatisTemplate.update("OrderAndActive.updateCustomerOrder", paraMap);
ibatisTemplate.update("OrderAndActive.updateOrderItemByCustOrderID", paraMap);
System.out.println("********OrderCompletionComponent******"+(System.currentTimeMillis()-start));
return null;
}

}

<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="100"
dataSource-ref="dataSource">
<jdbc:query key="orderQry"
value="select distinct (t.cust_order_id)
from customer_order t, order_item o
where t.status = '040'
and t.cust_order_id = o.cust_order_id
and o.status = '1501'
and o.order_item_cd = 'T20'
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:query key="userInfoSynQry"
value="select a.user_info_syn_id,
a.system_id,
a.action_type,
a.prod_spec_code,
a.product_no,
a.old_product_no,
a.user_state,
a.user_pay_type,
a.state
from user_info_syn a where a.state = '100'
and rownum between 0 and 100 order by a.add_time" />
<jdbc:query key="userInfoSynQry.ack"
value="update user_info_syn t set t.state = '200' where t.user_info_syn_id = #[map-payload:user_info_syn_id] " />
</jdbc:connector>

<endpoint name="CustomerOrderItemRequests" address="vm://customerOrderitem.requests" />
<vm:connector name="vmConnector" queueEvents="true" />

<model name="jdbcInboundActionModel">
<!-- 集团改造 -->
<!-- 激活流程 start -->
<service name="jdbcService">
<inbound>
<jdbc:inbound-endpoint queryKey="orderQry" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.OrderProcessComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="100" maxIdle="100" maxWait="150" />
</pooled-component>
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://orders" />
</pass-through-router>
</outbound>
</service>

<service name="creatXMLService">
<inbound>
<vm:inbound-endpoint address="vm://orders" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.ActiveXMLBuilderComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="200" maxIdle="200" maxWait="200" />
</pooled-component>
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://activeXML" />
</pass-through-router>
</outbound>
</service>

<service name="sendXMLService">
<inbound>
<vm:inbound-endpoint address="vm://activeXML" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.ActiveXMLSendComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="300" maxIdle="300" maxWait="300" />
</pooled-component>
</service>
<!-- 激活流程 end -->

<!-- 竣工流程 start -->
<service name="jdbcCompletionService">
<inbound>
<jdbc:inbound-endpoint queryKey="orderCompletionQry" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.OrderCompletionComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="100" maxIdle="100" maxWait="150" />
</pooled-component>
</service>
<!-- 竣工流程 end -->


<!-- 用户状态同步下发 -->
<service name="jdbcUserInfoSynService">
<inbound>
<jdbc:inbound-endpoint queryKey="userInfoSynQry" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.UserInfoSynXMLBuilderComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="100" maxIdle="100" maxWait="150" />
</pooled-component>
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://userInfoSynXML" />
</pass-through-router>
</outbound>
</service>

<service name="userInfoSynSendXMLService">
<inbound>
<vm:inbound-endpoint address="vm://userInfoSynXML" />
</inbound>
<!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused -->
<pooled-component class="com.tydic.mule.component.UserInfoSynXMLSendComponent">
<pooling-profile exhaustedAction="WHEN_EXHAUSTED_FAIL" initialisationPolicy="INITIALISE_ALL"
maxActive="200" maxIdle="200" maxWait="200" />
</pooled-component>
</service>


<!--
<service name="jdbcInboundActionService">
<inbound>
<jdbc:inbound-endpoint queryKey="orderQry" />
</inbound>
<component class="com.muleinaction.MuleDataServiceComponent" />
<outbound>
<pass-through-router>
<vm:outbound-endpoint address="vm://orders" />
</pass-through-router>
</outbound>
</service>
<service name="ThreeWebService">
<inbound>
<vm:inbound-endpoint address="vm://orders" />
</inbound>
<component class="com.muleinaction.ThreeWebServiceComponent" />
</service>
<service name="ClientWebService">
<inbound>
<vm:inbound-endpoint ref="CustomerOrderItemRequests" />
</inbound>
<component class="com.muleinaction.ClientCXFWebServiceComponent">
</component>
</service>
-->
</model>
</mule>
<!-- 用户状态同步下发 --><!-- 集团改造 --><!-- 激活流程 start --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- 激活流程 end --><!-- 竣工流程 start --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- 竣工流程 end --><!-- 用户状态同步下发 --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- 使用对象池技术,在系统启动时就会先创建一批对象(本配置为50个)放在对象池里,等发起调用时,系统不会创建新的对象,because the component will reused --><!-- <service name="jdbcInboundActionService"> <inbound> <jdbc:inbound-endpoint queryKey="orderQry" /> </inbound> <component class="com.muleinaction.MuleDataServiceComponent" /> <outbound> <pass-through-router> <vm:outbound-endpoint address="vm://orders" /> </pass-through-router> </outbound> </service> <service name="ThreeWebService"> <inbound> <vm:inbound-endpoint address="vm://orders" /> </inbound> <component class="com.muleinaction.ThreeWebServiceComponent" /> </service> <service name="ClientWebService"> <inbound> <vm:inbound-endpoint ref="CustomerOrderItemRequests" /> </inbound> <component class="com.muleinaction.ClientCXFWebServiceComponent"> </component> </service> -->

分享到:
评论

相关推荐

    mule &amp;amp; seda 学习二.docx

    mule &amp;amp; seda 学习二.docx

    mule学习笔记(初学者)

    这是mule入门时的学习笔记,供大家参考。对于初学者安装来说非常有效。

    mule学习文档

    此学习文档为mule,主要用于对开源框架mule的学习。有助于提高开发效率

    Mule3.4入门学习

    描述如何通过Mule实现Webservice的发布、实现JMS消息通信、ftp、File应用、协议转换等

    mule 学习.zip

    包含http、cxf、vm、sap、activeMq、ftp、file、poll、Smtp、attachment、melExpression、Java、template节点的使用示例等。

    mule IDE (mule ESB)

    Mule ESB 是一个轻量级的基于java的企业服务总线和集成平台, 使得开发人员可以快速,简单的连接多个应用, 使得它们可以交换数据。 Mule ESB 容易集成现有异构系统,包括:JMS, Web Services, JDBC, HTTP, 等. ESB...

    mule学习资料java轻量级框架

    mule的介绍和案例..............................................

    mule整体概念学习

    本文档适合初学mule的童鞋们,文档里面的内容参照了, 以下链接 http://my.oschina.net/moon/blog/10701 大家可以先看一下。 我在这基础上整理成一个word文档了并加了一些内容。收你一积分完全划算。有兴趣的朋友看...

    mule standalone server 3

    mule standalone server 3

    mule文档详解 mule

    Mule是一个企业服务总线(ESB)消息框架,而且Mule是一个轻量级且高度可扩展的ESB。

    mule ESB 3 user guider

    mule esb 3 user guider: 社区成熟,文档丰富的开源esb mule用户手册

    应用集成开源框架MULE的源代码

    Mule 的核心是一个基于SEDA的服务容器,该容器管理被称为通用消息对象(Universal Message Objects /UMO)的服务对象,而这些对象都是POJO。所有UMO和其他应用之间的通信都是通过消息端点(message endpoint)来进行...

    Mule in Action, 2nd Edition

    Mule in Action, Second Edition is a totally-revised guide covering Mule 3 fundamentals and best practices. It starts with a quick ESB overview and then dives into rich examples covering core concepts ...

    mule in action 说明+文档介绍

    mule in action 和doc文档详细介绍 Mule的核心组件是UMO(Universal Message Objects,从Mule2.0开始UMO这一概念已经被组件Componse所代替),UMO实现整合逻辑。...Mule 3版本以后集成OSGi,支持热部署。

    mule in action 即mule实战源码

    企业服务总线ESB中用户数量大,文档丰富,社区成熟的一款开源ESB。

    mule -esb 源码

    mule -esb 源码

Global site tag (gtag.js) - Google Analytics