Created
December 1, 2011 13:42
-
-
Save germanrsolis/1416807 to your computer and use it in GitHub Desktop.
xa-gist-4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:file="http://www.mulesoft.org/schema/mule/file" | |
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" | |
xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" | |
xmlns:test="http://www.mulesoft.org/schema/mule/test" xmlns:client="http://www.mulesoft.org/schema/mule/client" | |
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:management="http://www.mulesoft.org/schema/mule/management" | |
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" | |
xmlns:sxc="http://www.mulesoft.org/schema/mule/sxc" xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts" | |
xsi:schemaLocation=" | |
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd | |
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.2/mule-file.xsd | |
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd | |
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd | |
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.2/mule-jms.xsd | |
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.2/mule-vm.xsd | |
http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd | |
http://www.mulesoft.org/schema/mule/client http://www.mulesoft.org/schema/mule/client/3.2/mule-client.xsd | |
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.2/mule-cxf.xsd | |
http://www.mulesoft.org/schema/mule/management http://www.mulesoft.org/schema/mule/management/3.2/mule-management.xsd | |
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.2/mule-scripting.xsd | |
http://www.mulesoft.org/schema/mule/sxc http://www.mulesoft.org/schema/mule/sxc/3.2/mule-sxc.xsd | |
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.2/mule-xml.xsd | |
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/3.2/mule-jbossts.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | |
<context:property-placeholder location="classpath:jdbc.properties" /> | |
<jbossts:transaction-manager /> | |
<spring:beans> | |
<spring:bean id="oraDataSource" class="oracle.ucp.jdbc.PoolXADataSourceImpl"> | |
<spring:property name="URL" value="${jdbc.url}" /> | |
<spring:property name="user" value="${jdbc.user}" /> | |
<spring:property name="password" value="${jdbc.pass}" /> | |
<spring:property name="connectionFactoryClassName" | |
value="oracle.jdbc.xa.client.OracleXADataSource" /> | |
<spring:property name="minPoolSize" value="10" /> | |
<spring:property name="maxPoolSize" value="20" /> | |
<spring:property name="connectionWaitTimeout" value="30" /> | |
</spring:bean> | |
<spring:bean id="mySqlDataSource" | |
class="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"> | |
<spring:property name="url" | |
value="jdbc:mysql://${mysql.host}:${mysql.port}/${mysql.database}?user=${mysql.user}&password=${mysql.pwd}" /> | |
</spring:bean> | |
</spring:beans> | |
<spring:bean id="dbQuerySql" class="java.lang.String"> | |
<spring:constructor-arg> | |
<spring:value> | |
SELECT * FROM TEST; | |
</spring:value> | |
</spring:constructor-arg> | |
</spring:bean> | |
<jdbc:connector name="jdbcConnectorDest" dataSource-ref="oraDataSource"> | |
<jdbc:query key="insert_call" value="CALL INSERT_FIELD ('test')" /> | |
</jdbc:connector> | |
<jdbc:connector name="jdbcConnectorSource" | |
dataSource-ref="mySqlDataSource"> | |
<jdbc:query key="selectQuery" value-ref="dbQuerySql" /> | |
</jdbc:connector> | |
<flow name="main"> | |
<jdbc:inbound-endpoint queryKey="selectQuery" | |
connector-ref="jdbcConnectorSource" pollingFrequency="10000"> | |
<xa-transaction action="ALWAYS_BEGIN" /> | |
</jdbc:inbound-endpoint> | |
<test:component logMessageDetails="true" /> | |
<jdbc:outbound-endpoint queryKey="insert_call" | |
connector-ref="jdbcConnectorDest"> | |
<xa-transaction action="ALWAYS_JOIN" /> | |
</jdbc:outbound-endpoint> | |
</flow> | |
</mule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment