Mule3配置文件

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      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:http="http://www.mulesoft.org/schema/mule/http"
      xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
      xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
      xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
      xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp"
      xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
   xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
   xmlns:jee="http://www.springframework.org/schema/jee"
   xmlns:util="http://www.springframework.org/schema/util"
   xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
      xsi:schemaLocation="
        http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.mulesoft.org/schema/mule/corehttp://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
        http://www.mulesoft.org/schema/mule/httphttp://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
        http://www.mulesoft.org/schema/mule/vmhttp://www.mulesoft.org/schema/mule/vm/3.1/mule-vm.xsd
        http://www.mulesoft.org/schema/mule/jmshttp://www.mulesoft.org/schema/mule/jms/3.1/mule-jms.xsd
        http://www.mulesoft.org/schema/mule/tcphttp://www.mulesoft.org/schema/mule/tcp/3.1/mule-tcp.xsd
        http://www.mulesoft.org/schema/mule/cxfhttp://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
        http://www.mulesoft.org/schema/mule/stdiohttp://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
        http://www.mulesoft.org/schema/mule/filehttp://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
        http://www.mulesoft.org/schema/mule/jdbchttp://www.mulesoft.org/schema/mule/jdbc/3.1/mule-jdbc.xsd
        http://www.springframework.org/schema/jeehttp://www.springframework.org/schema/jee/spring-jee-3.0.xsd
       http://www.springframework.org/schema/utilhttp://www.springframework.org/schema/util/spring-util-3.0.xsd">

 <custom-transformer name="muleservice" class="com.test.cxf.transferCxf" /> 
 
 <custom-transformer name="stringToInteger" class="com.test.cxf.StringToInteger" />
 <custom-transformer name="HttpRequestToNameString"
  class="org.mule.example.hello.HttpRequestToNameString" />
 <custom-transformer name="HttpRequestToParameter" class="org.mule.transport.servlet.transformers.HttpRequestToParameter"/>
 <custom-transformer name="AToB" class="com.test.cxf.transformer.AToBTransformer"/>
 <custom-transformer name="BToA" class="com.test.cxf.transformer.BToATransformer" />
 
 <spring:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <spring:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  <spring:property name="url" value="jdbc:mysql://localhost:3306/"/>
  <spring:property name="username" value="root"/>
  <spring:property name="password" value="123"/>  
 </spring:bean>
 
 <expression-transformer name="ExtractSymbol">
        <return-argument evaluator="map-payload" expression="symbol" />
    </expression-transformer>
   
   <jdbc:connector name="jdbcConnector" dataSource-ref="dataSource" pollingFrequency="1000" queryTimeout="-1">
     <jdbc:query key="saveUser" value="insert into user_base (username,password,email) values (#[map-payload:username],#[map-payload:password],#[map-payload:email])"/>
     <jdbc:query key="getAllUser" value="select * from user_base u"/>
    </jdbc:connector> 
 
 <flow name="in">
  <inbound-endpoint address="http://localhost:8889/service/AToB"      
     exchange-pattern="request-response">
     <cxf:jaxws-service serviceClass="com.test.cxf.newCxf.INewCxf" />
  </inbound-endpoint>
  <component>
   <singleton-object class="com.test.cxf.newCxf.NewCxfImp"></singleton-object>
  </component>
  <custom-transformer class="com.test.cxf.transformer.AToBTransformer"></custom-transformer>
  <flow-ref name="out"/>
 </flow>
 <flow name="out">  
  <outbound-endpoint address="http://xop.xiu.com:8080/Demo/cxf/cxftest"      
     responseTransformer-refs="BToA"
     exchange-pattern="request-response">
      <cxf:jaxws-client  serviceClass="com.test.cxf.ICxf" operation="getB" />
  </outbound-endpoint>
 </flow>
 <flow name="jdbc_store">
  <jdbc:outbound-endpoint queryKey="getAllUser" connector-ref="jdbcConnector" queryTimeout="100" exchange-pattern="request-response">
   <jdbc:transaction action="ALWAYS_BEGIN"/>
  </jdbc:outbound-endpoint> 
 </flow>
</mule>

jdbc的没写完,少了转换器,呵呵,读者注意了


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值