Using Parameters in Your Mule Configuration Files

Although I am not always happy with the online documentation of the Mule ESB I found this article quite good. I have set up our configuration of Mule ESB implementation on several projects this way and it has proved to be working nicely. Although last time I got into the following issue. To use a datasource in my Mule3 project I had configured it like this in my Mule config file:

1
2
3
4
5
6
7
<jdbc:oracle-data-source 
          name="jdbcDataSource" 
          user="${db.username}" 
          password="${db.password}" 
          host="${db.host}" 
          port="${db.port}" 
          sid="{db.sid}" />

However, when I deployed the application on my Mule instance I got the following XML parse exception:

org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: ‘${db.port}’ is not a valid value for ‘integer’.

This is caused by the fact that the XML is validated against its XSD before the parameters are resolved. Although I found threads in several forums that described a solution for this issue I chose the following (pragmatic) solution. I decided to configure the datasource like this:

1
2
3
4
5
<jdbc:oracle-data-source 
         name="jdbcDataSource" 
         user="${db.username}" 
         password="${db.password}" 
         url="jdbc:oracle:thin:@//${db.host}:${db.port}/${db.sid}" />

This way the XML validates fine against its XSD and during runtime the parameters are resolved.

Use Mule3 as WS-Security proxy

As I wrote before it is quite easy to set up a web service proxy with Mule3. in this example I take it a step further and I describe how you can add WS-Security implementation to it. Although in the end this also is quite easy you have to make the correct configuration choices to get everything to work.

The first thing I had to do in my Mule config was to drop the pattern prefix. This took me a while to discover because I think this isn’t very clear in the documentation. Anyway, after that change it is fairly straight forward.
Read more

Command-line Execution of Maven Plugins with Default Configuration

In Maven, plugins can be coupled to a Maven lifecycle phase and the configuration can be stored in your pom.xml. This is very convenient if you would like to perform some extra steps when, for example, you are deploying a web application.

But, what if you would like to execute a specific goal of a plugin and use the configuration in your pom.xml?

Read more

Automagically deploy your web application using the Maven Cargo plugin.

Last week I optimized the deployment process of a number of Mavenized projects. I noticed that the way I automated the project was not yet (fully) known by the developers. This is why I decided to write this blogpost.

It appeared to be a true eyeopener for the developers.

Read more

Creating tarballs on OSX _without_ the garbage

Just spent a costly 30 minutes finding out how to create a tgz tarball on OSX Lion without all the hidden ._ files. These files are the result of using the HFS or HFS+ filesystem.

What I got when issuing a tar -zcvf my-package.tar.gz dir1/ was a structure like this:

1
2
3
4
5
6
7
8
9
10
11
.
._dir1
dir1
  ._file1
  file1
  ._file2
  file2
  ._subdir
  subdir
    ._file3
    file3

When extracting this tarball on Linux, you’ll get all the unnecessary ._ files.

To prevent them from being packaged in the first place, issue the following command from your Terminal: export COPYFILE_DISABLE=true

PS: You could make this setting ‘stick’ by adding them to your ~/.bash_profile

The result now will be a nice and clean tarball:

1
2
3
4
5
6
.
dir1
  file1
  file2
  subdir
    file3

Set up Web Service Proxy with Mule3

In this post I show you how I setup a little test to see if and how easy I could manage to route the traffic to and from a web service through Mule ESB. The business case for this is an issue that one of our customers ran into when using web services. In a program hundreds of calls are done in a relative short period. Most of the time this isn’t a problem but sometimes vague issues occur. To get a better insight in this issue I want to put Mule in the middle so I can log the request and response and hopefully get a better idea about what is sent across the line. This is called the Web Service Proxy pattern and is commonly used to validate and audit the web service calls. For more background info about this pattern see this article.
Read more

Unit test your Spring/Hibernate and MongoDB setup

In my previous post I described how you can setup Spring and Hibernate in combination with the MongoDB. In this post I show you how you can write your unit test for this setup including a workaround for the fact that there isn’t an embedded version of MongoDB.
Read more

Use Spring and Hibernate with MongoDB

One of the requirements we have for one of our Mule ESB implementations is to log the messages that went through the ESB (especially handy during development and testing). There has been written a lot already about logging with Mule so I am not going to discuss that again. In this post I’ll only show you how you can use Spring/Hibernate and MongoDB to store your messages in the MongoDB, because a document-oriented database like MongoDB is a nice fit for this requirement.
Read more

Use Mule to sync WordPress sites

I got triggered by my previous post to create a process with which I could keep two instances of WordPress in sync. I wanted to see if I could do this with Mule. I came up with the following solution:

  • Receive the RSS feed of a new post in Mule flow
  • Use the content of the RSS feed to post to the other wordpress instance by using XML-RPC
  • Have it running on Mule iON so I don’t have to setup my own Muleserver

Read more

Writing your own Altova MapForce Extension

In a previous post, I mentioned that you could extend the function library in Altova MapForce and add your own functions. In this post I’ll show you (briefly) how to do this using the Java methods from the previous post.

Read more