Thursday, August 30, 2012

ServiceMix on the bleeding edge

Why stable dependencies are cool

ServiceMix (and Fuse ESB as well) are supposed to work with a specific version of Camel. For example ServiceMix 4.4.2 comes with a pre-configured Camel 2.8.5 features repository.
karaf@root> features:listurl | grep camel
  true    mvn:org.apache.camel.karaf/apache-camel/2.8.5/xml/features
The same rule is applied to the ActiveMQ and CXF dedicated for every release of the ServiceMix.

This is pretty cool approach since it guarantees you that sticking to the given version of Camel (ActiveMQ, CXF, ...) will result in a stable ServiceMix installation. ServiceMix team invested pretty lots of effort to make sure that Camel in version X works nicely on ServiceMix in version Y. Fuse ESB is tested even more, to guarantee the highest level of the product.

Why stable dependencies are NOT cool

The downside of such stable versioning strategy is that you need to wait a long time before updating to the latest version of Camel (or CXF or whatever).

For example, if I committed Spring Batch component to the Camel and it has been released in Camel 2.10, then I'll need to wait for ServiceMix to use the higher version of Camel and Karaf. In this particular example Karaf 2.2.4 included in the latest stable version of ServiceMix (i.e. 4.4.2) doesn't support Camel 2.10.
karaf@root> features:install camel-spring-batch/2.10.0
Error executing command: Can not resolve feature:
Unsatisfied requirement(s):

Bleeding edge ServiceMix

What to do if you really need to work with the latest version of the ServiceMix stack? Download the latest version of Apache Karaf and manually add Camel (CXF, ActiveMQ, etc) support into it.

For example to use the latest Camel (i.e. 2.10) I can download the latest Karaf (i.e. 2.2.9) and arm it with the Camel 2.10 features repository.
karaf@root> features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.10.0/xml/features
Then I enable feature responsible for bootstrapping Camel modules backed by Spring.
karaf@root> features:install camel-spring
At last but not least I enjoy the brand new Camel modules.
karaf@root> features:install camel-spring-batch/2.10.0
Now I can drop my integration solution using the latest Camel 2.10 into my hand-made bleeding edge ServiceMix. :)


  1. Hi Henryk,
    Interesting post. I find myself in a similar situation. I would like to take advantage of a bug fix in Camel 2.9 in the camel-netty component but I am currently bound to ServiceMix 4.4.2. I thought about downloading the latest karaf and doing exactly what you suggest - I worry though that it will be a long time before ServiceMix 4.5.0 is released (there is no indication of this on the ServiceMix site). However currently only rely on Camel, ActiveMQ (CXF in the future most likely) features of ServiceMix but we would like to take advantage of clustering etc., In your opinion can clustering be equally well achieved by using Karaf + Cellar for example ?

  2. Hi Declan,

    Unfortunately I got no experience with Cellar. From what I know about Cellar, the Fuse Fabric can be easily used a equivalent solution. I got pretty good experiences with Fabric.

    Regarding the clustering - what exactly do you cluster? Approach to cluster ESB depends heavily on the endpoints you actually want to cluster :) .

    If you cluster JMS, the Fuse Fabric will be a pretty good choice.

    Best regards.