Skip to content

Instantly share code, notes, and snippets.

<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
@germanrsolis
germanrsolis / case6121-test-config.xml
Created October 26, 2012 13:34
How to control if the current node is the primary polling instance
<flow name="main">
<jms:inbound-endpoint queue="in" />
<!-- check if this application is running in the primary pooling instance -->
<choice>
<when evaluator="groovy" expression="muleContext.isPrimaryPollingInstance() == true">
<!-- process the message -->
<append-string-transformer message=" Received" />
<logger level="INFO" message="#### IS PRIMARY POLLING INSTANCE, PROCESSING THE MESSAGE" />
<vm:outbound-endpoint path="out"/>
<all>
<flow-ref name="flow1" />
</all>
</flow>
<flow name="flow1">
<outbound-endpoint ref="outbound" />
</flow>
@germanrsolis
germanrsolis / gist:1417287
Created December 1, 2011 14:49
xa-gist-6
<jdbc:outbound-endpoint queryKey="insert_call"
connector-ref="jdbcConnectorDest">
<xa-transaction action="ALWAYS_JOIN" />
</jdbc:outbound-endpoint>
@germanrsolis
germanrsolis / gist:1417283
Created December 1, 2011 14:48
xa-gist-5
<jdbc:inbound-endpoint queryKey="selectQuery"
connector-ref="jdbcConnectorSource" pollingFrequency="10000">
<xa-transaction action="ALWAYS_BEGIN" />
</jdbc:inbound-endpoint>
@germanrsolis
germanrsolis / gist:1416807
Created December 1, 2011 13:42
xa-gist-4
<?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"
@germanrsolis
germanrsolis / gist:1416722
Created December 1, 2011 13:27
xa-gist-3
<jdbc:connector name="jdbcConnectorSource"
dataSource-ref="mySqlDataSource">
<jdbc:query key="selectQuery" value-ref="dbQuerySql" />
</jdbc:connector>
<jdbc:connector name="jdbcConnectorDest"
dataSource-ref="oraDataSource">
<jdbc:query key="insert_call" value="CALL INSERT_FIELD ('test')" />
</jdbc:connector>
@germanrsolis
germanrsolis / gist:1416714
Created December 1, 2011 13:27
xa-gist-2
<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" />
@germanrsolis
germanrsolis / gist:1407027
Created November 29, 2011 23:01
xa-gist-1
<mule xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/3.2/mule-jbossts.xsd">
<jbossts:transaction-manager />
@germanrsolis
germanrsolis / JDBC_ExternalQueries_3
Created October 21, 2011 00:19
JDBC - External Queries - 3
<?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:jdbc="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd