Last week I migrated our site and blog to the Cloud. I got triggered by this article. That in the combination with the free account at Amazon’s EC2 was enough for me give it a try. Read more
Mule in the Cloud: First impression
Like I posted before Mulesoft has released a new platform: iPAAS. I just went through the starters guide and I am pretty impressed. Of course the use case in the tutorial is very simple but the whole idea of just putting your Mule config into the cloud and it runs sounds good. And I have seen it working (you can check for yourself by submitting text to this url. Read more
New products from Mulesoft
Mulesoft recently released some new products, totally different from each other but both very welcome.
The first one is MuleStudio. Mule Studio is an Eclipse-based developer tool, that allows to graphically create and test Mule ESB Flows. It is currently in beta but I think it might be a good reason to go back to Eclipse. Last few years I have been using Netbeans for my Mule/Java development because I liked the combination between Netbeans and Maven better.
The other ‘product’ that is released is Mule iON. I think a graphical development tool is nice to have but this iON thing is something that can really become big. It makes you use the cloud as the platform for your integration software. They call it the iPAAS (Integration Platform as a Service).
The coming days I will have a look at both and posts my findings here so stay tuned!
Citrus testcase example: CSV File Inbound -> Xml Http Outbound
As promised I’m going to show a test case for which I have used Citrus to implement it. The case is like this:
In a predefined folder on a machine a character-separated file is placed. This file is picked up by our Mule ESB application. The content is transformed to XML and this XML document is posted to another application over HTTP. This application responds with XML document telling the document was processed correctly.
To test this interface with Citrus we have to perform the following steps:
- Copy the input test-file to the predefined folder so it is picked up by the test instance of our Mule ESB
- Have Citrus listen on a predefined HTTP port to receive the XML message over HTTP
- Reply to the received message with a predefined XML message
Our Mule ESB will poll a directory each second to check if there is placed a new file to process. Our test case starts by having Citrus putting a test file in the directory .
Inside our Mule ESB the file is transformed to XML message and posted on a HTTP port to be processed by the ‘ORDER’ system. We have configured Citrus to listen on this specific HTTP port to pick up the XML message.
This steps mimics the ‘ORDER’ system as it would normally process the incoming XML message and respond with another XML message. In this case Citrus will send back a predefined XML message as response.
Setup Citrus for testing Mule ESB
Recently, I ran into an open-source test framework called Citrus. Citrus supports you in testing message interfaces in enterprise applications. Manual testing effort as well as coding mocks and simulators are not necessary. Instead Citrus enables integration testing in an automated way with out-of-the-box simulation of various message transports. We’ll use it to test our Mule based ESB.
Mule, of course, offers great possibility to unit test your application. And we also have a test setup which ‘talks’ to other applications. What we didn’t have was a testing environment which we could use to test the ESB as a blackbox without being dependent on other (external) applications. And this is exactly where Citrus comes in. Citrus makes it possible to test the complete lifecycle of a message flow without being dependent of other systems, actually with Citrus you proxy these dependencies.
In this post I will provide details and tips on how to setup and use Citrus. Although the documentation that is available is easy to read, it is not complete. It took me quite some effort to get it all running but like I said before the benefits of this framework are huge.
Read more
TcpTunnelGui: maybe old but still useful
Although the TcpTunnelerGui has been around for a while (for about 10 years now) it is still helping me out in several situations. The only thing I keep forgetting is where to get it and what the exact syntax is to run it. So for future reference I put it in this post (and hope I remember this post…).
- Download the jar (soap-2.3.jar) containing the necessary classes here
- Open a command prompt/ terminal and go the location where the jar is located
- Run the following command
java -classpath soap-2.3.jar org.apache.soap.util.net.TcpTunnelGui 8081 localhost 8080
For more info about the tunneler see here. So, now when I need this tunneler in the future I know where I can find it and how to use it :-)
XSLT 2.0 and Java Extensions
We use a fair lot of XSLT transformations in our projects. Since making XSLT stylesheets is a tedious and error-prone job, we use Altova MapForce to do the job. MapForce is very versatile, but can not always cope with the requirements our customers come up with. This time, the customer asked us to implement some sort of maintainable translation mechanism. This mechanism should be able to translate incoming values using a user maintainable collection of values. This way, the transformation process does not need to be changed if a translation is added or updated.
Adding a (hardcoded) parameterized XSLT template is not an option, because this is not maintainable without changing the stylesheet. The answer? XSLT Java extensions!
In this blog I’ll show you a simple example on how to use Java extensions in a XSLT 2.0 stylesheet.
Removing DiffGram element in web service messages
Some time ago I was asked to review existing web services for a customer. The main thing I noticed was that they were using Microsoft’s diffgram elements and attributes in their input and output messages. I was not familiar with this format but found out that it has been created by Microsoft to make synchronizing datasets in .Net easier. In this case the web services were implemented with Spring-WS, so there was no real reason to use this format on the server side. Besides, it only makes the web service less useful on the client side since it leads to complications if you want to use a XML-Object mapper like JAXB (see this for example). One of the issues with Diffgram is that, besides the XML containing the Diffgram element, also the XSD is included. This XSD describes the content of the Diffram Dataset, however, the XSD and the resulting Dataset do not match because extra attributes are added (this is described in more detail here). Read more
Using parameters with XSLT in Mule
Recently I got into a situation where I had to put ‘metadata’ values (which were part of the Mule Message) into the XML result of an XSLT transformer. Let me explain the situation with an example. Imagine you have an ‘order’ xml that needs to be translated into an ‘invoice’ xml. Here is a simple ‘order.xsd’:

The mapping for the transformation looks like this in MapForce:
Read more
Unit Test Mule with ActiveMQ defined as datasource
In a previous post I described how you can configure an ActiveMQ connection-factory as datasource in Tomcat. Although this works great in a deployed Mule application you can’t use this technique in your unit tests! So in this post I describe how we set up our test environment. Read more

