Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am svacas on github.
  • I am svacas (https://keybase.io/svacas) on keybase.
  • I have a public key ASBSkBPVblUWJYdqOuYeOmWJFCmVN-WL_P_4H8OxkVuEdwo

To claim this, I am signing this object:

@svacas
svacas / spring-3.1-profiles.xml
Created February 8, 2012 01:57
spring 3.1 profiles
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"...>
<spring:beans profile="prod">
<mule>
<jms:activemq-connector name="JmsConnector"
brokerURL="failover:(tcp://172.16.10.1:61616, tcp://172.16.10.2:61616)"/>
</mule>
</spring:beans>
@svacas
svacas / spring-3.1-schema.xml
Created February 8, 2012 00:09
spring 3.1 schema
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:spring="http://www.springframework.org/schema/beans"
...
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
...
@svacas
svacas / foreach_xpath_full.xml
Created February 8, 2012 00:03
foreach & xpath full config
<?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:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
xmlns:email="http://www.mulesoft.org/schema/mule/email"
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/http http://www.mulesoft.org/schema/mule/http/3.2/mule-http.xsd
@svacas
svacas / PurchaseOrder.xml
Created February 7, 2012 20:16
PurchaseOrder.xml
<?xml version="1.0"?>
<PurchaseOrder PurchaseOrderNumber="99503">
<Address>
<Name>Ellen Adams</Name>
<Email>ellen@adams.org</Email>
<Zip>10009</Zip>
<Country>USA</Country>
</Address>
<Items>
<Item PartNumber="872-AA">
@svacas
svacas / foreach_xpath.xml
Created February 7, 2012 20:13
foreach & xpath
<flow name="process-order">
<http:inbound-endpoint address="http://localhost:8088/process-order"/>
<object-to-string-transformer/>
<foreach expression="#[xpath:/PurchaseOrder/Items/Item]">
<choice>
<when expression="#[xpath:/Item/GiftWrap/text()='true']">
<jms:outbound-endpoint queue="giftwrap.queue" exchange-pattern="one-way"/>
</when>
<otherwise>
<jms:outbound-endpoint queue="regularwrap.queue" exchange-pattern="one-way"/>
<script:component>
<script:script engine="groovy">
<script:text>
map =(Map)payload;
if(!map.get(0).equals("Test"))
throw new RuntimeException("**************"+map.get(0)+"*************");
else
println "************Anda********************"
</script:text>
@svacas
svacas / FtpErrorTestCase.java
Created October 12, 2011 13:16
BMUnit test using Mule 3.2
@RunWith(BMUnitRunner.class)
public class FtpErrorTestCase extends AbstractFtpServerTestCase
{
public FtpErrorTestCase()
{
super(ConfigVariant.FLOW, "ftp-message-requester-test.xml");
}
@BMRule(name = "throw ftp exception",
targetClass = "FTPClient",
<?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:ftp="http://www.mulesoft.org/schema/mule/ftp"
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/ftp http://www.mulesoft.org/schema/mule/ftp/3.1/mule-ftp.xsd">
<ftp:connector name="ftpConnector" />
@RunWith(BMUnitRunner.class)
public class FtpErrorTestCase extends AbstractFtpServerTestCase
{
@Override
protected String getConfigResources()
{
return "ftp-message-requester-test.xml";
}
@BMRule(name = "throw ftp exception",