Unexpected behavior using Mule Expression Language

6 Apr

mulesoft-logoWhile developing flows with a recent Mule ESB there is a big chance you will make use of MEL in your configuration. Although this feature has added great benefits while developing Mule flows it sometimes drives me crazy. In this post I will show two examples which took me some time to get it working.
The first was when I was using an expression-transformer to get a part of an XML document as payload. The expression I tried first was: Continue reading

Using encrypted passwords with Mule ESB

9 Mar

A good practice in the Mule ESB is to supply properties by using a property file. Most of the time you will end up adding passwords to the properties file. In that case you might want to encrypt the passwords so it is not visible for every one who has access to the property file. Mulesoft described how to do this in combination with the Mule ESB. Although it is a good starting point I thought it may help to create a complete example so I put all the steps in this post. There are two environments that have to be modified: the development environment and the runtime environment.
Continue reading

Unit testing with Mule ESB 3.4 Enterprise Edition

12 Feb

There is a big chance that when you are using the Mule ESB EE as your ESB implementation and you are creating functional/unit tests you sooner or later will need a license on your test classpath to be able to run Mule in your unit tests. Luckily this isn’t very hard to accomplish. You can just take the license file that is generated when installing your license at the (standalone) server. You can find the license file on the server here: $MULE_HOME/conf/muleLicense.lic. Just copy it to your
‘$PROJECT_HOME/src/test/resources/’ folder so it an be accessed on the classpath.
Till so far fo the happy scenario. However after doing this I ran into the following exception

Caused by: java.lang.ClassNotFoundException: com.mulesource.licm.LicenseKeyException

Continue reading

Message Throttling with Mule ESB

31 Jan

mulesoft-logoWhile implementing the Mule ESB I ran into the following scenario:
Messages were picked up from a queue, the message was transformed, offered to a web service, the response was transformed and put on a response queue.
Not an unusual use case in the world of integration. One thing that made this one special was the (lack of) performance of the web service. It appeared as soon as we started to send messages to the services via the ESB the response time for each of the messages increased significally. Investigation showed that the web service was having serious issues when concurrent messages were sent. This is what the Mule ESB do by default. It will start of with a set of threads to process the messages as quickly as possible. Until the issue with the web service is solved I decided to add throttling functionality to my flow so I could manage the number of calls to the web service. Continue reading

Running multiple ActiveMQ instances on one machine

19 Jan

A few weeks ago I started making use of Apache ActiveMQ again as the JMS provider with my Mule ESB solution. Since it had been a few years that I used ActiveMQ I thought it would be nice to check out some of the (new) features like the failover transport and other clustering features. To be able to test these last things I needed multiple installations of ActiveMQ on my machine. Luckily this isn’t very hard to accomplish, although the documentation on this on the ActiveMQ site is quite minimal.
Apache-activemq-logo Continue reading

Automated deployment with Mule Management Console and Maven

3 Jan

In my opinion a deployment of any application should be as automated as possible to avoid errors due to manual mistakes. This is no different with a Mule ESB application. If you are using the Enterprise Edition of the Mule ESB you also have the ability to make use of the Mule Management Console (MMC). This instrument makes the governance of the deployment of your Mule applications into different environments easier and therefore the whole deployment cycle less error-prone. Continue reading

Populate your Maven repo with Mule ESB libraries

20 Nov

Update: I recently discovered that the Mule EE libraries are available in a Maven repository. You have to have a Mule EE license to obtain the credentials. More info about it here. This option would make the remainder of the post redundant.

When you build applications based on Mule EE (Enterprise Edition) and you are using Maven to build your projects you will notice you have dependencies to libraries that are not available in the public Maven repos. To add these libraries to your local maven repo the Mule distribution comes with a script ‘populate_m2_repo’ which is described here how to use it. Continue reading

Validating XML message in Mule 3

10 Nov

A quite common use case in a flow in the Mule ESB is validating if an XML document is valid against a corresponding XSD. Especially if a project is in the development/test stage it can be quite annoying to find out you have spent a lot of time fixing an issue when it was actually caused by another system which was supplying invalid XML.
The ‘standard’ way to do this in Mule is by using the schema-validation-filter and especially in combination with the message-filter. For example the following configuration will send all non-valid messages to the ‘process-invalid-xml’ flow:

<message-filter onUnaccepted="process-invalid-xml" throwOnUnaccepted="true">
    <xml:schema-validation-filter .../>

Continue reading

Reviewing the Mule Cookbook from PacktPublisher

20 Oct

Since a few months I am involved in a few Mule ESB projects again. Although it had been a while working with Mule they still know where to find me for some project work with the Mule ESB :-)
At the same time I was contacted by PacktPub to review their latest book about Mule 3: Mule ESB Cook Book.
I was really looking forward to it. Although I have been using Mule for quite some time and in different environments I haven’t had a project that didn’t teach me something new. So I was hoping to pick up some more hidden gems I wasn’t aware of. However, it is not going to be this book that is showing me some hidden gems. I am not sure who would take advantage of the book to be honest. The recipes discuss rather simple use cases in my opinion and mostly show how to work your way through the Mule Studio, which offers a graphical interface to create your Mule flows. If you want a deeper understanding of the Mule ESB this book isn’t for you. Also I don’t expect this book will be of much use if you run into some real world issues because it is simply too simplistic. The good news is that this leaves space for a more advanced Mule cookbook by, for example, by David Dossot ;-)

Run your Hadoop MapReduce job on Amazon EMR

3 Sep

I have posted a while ago how to setup an EMR cluster by using CLI. In this post I will show how to setup the cluster by using the Java SDK for AWS.
The best way to show how to do this with the Java AWS SDK is to show the complete example in my opinion, so lets start.

  • Set up a new Maven project
  • For this task I created a new default Maven project. The main class in this project is the one that you can run to initiate the EMR cluster and perform the MapReduce job I created in this post: Continue reading


Get every new post delivered to your Inbox.

Join 82 other followers