Blog de Nicolas DUMINIL

Lasciate ogni speranza vuoi che entrate qui !

Camel and JBoss Fuse Service Works

Publié le 21/03/2014

EIPs (Enterprise Integration Pattern) are ubiquitous nowadays. Praised by acclaimed software architects like Martin Fowler and Kent Beck, they became very popular thanks to the Gregor Hohpe and Bobby Wolf book, known under the name of the “EIP book” and published by Addison Wesley in 2004. This book described 65 software architecture patterns, each one representing a solution to a design challenge in the integration space. This was the theory and, as such, it was already a huge step towards the standardization of the enterprise software architecture, however the industry still lacked an implementation of the design patterns described in the book. James Strachan, Rob Davies, Guillaume Nodet, Hiram Chirino and others, within the open source communities of Apache ActiveMQ and Apache ServiceMix, brought the idea of Camel to life. Apache Camel is essentially an implementation of the EIP book, and its version 1.0 was released in the summer of 2007.


Apache Camel is an integration framework whose main goal is to make integration easier. It implements many of the EIP patterns and allows people to focus on solving business problems, freeing them from the burden of plumbing. But the open-source projects history is often over-subtle. Released under an Apache Foundation license, Camel was provided “as is”, i.e. without too much documentation, not always fully tested and supported only by the Apache community. Consequently, developing a real expertize with Apache Camel was fastidious and time consuming, which created the premises of a quite new market, consisting in sailing re-packaged releases, more carefully tested, professionally documented and with a commercial technical support. 


This is what Progress Software Ltd. did in the beginning of 2008 and, as the company changed its name one year later and became Fuse Source, probably in order to make reference to Spring Source and hoping to achieve an equivalent success, Camel changed its name as well and became Fuse Mediation Router. Fuse Source has successfully got down to work during several years and provided services not only around Camel/Fuse Mediation Router, but also around ActiveMQ (Fuse Message Broker), ServiceMix (Fuse Service Bus) and CXF (Fuse Services Framework). But in 2012 they got bought by RedHat, who was looking to improve its JBoss SOA Platform. Finally, the Fuse Source solutions, declined in four main products, Fuse Message Broker, Fuse Service Bus, Fuse Mediation Router and  Fuse Services Framework, leveraging respectively Apache ActiveMQ, Apache ServiceMix, Apache Camel and Apache CXF, have been integrated by RedHat into one product named JBoss Fuse, running  on the Karaf server, the Apache OSGi platform. Confused ? Yes, you can. And to complicate everything even more, as RedHat became one of the majors in the Java EE 6 landscape after the acquisition of JBoss Ltd., essential modules of Fuse Service Bus (Apache ServiceMix) and Fuse Mediation Router (Apache Camel) have been integrated on the top of JBoss EAP (Enterprise Application Platform) 6 in a new platform named JBoss Fuse Services Work 6, which is the new commercial name of the JBoss SOA Platform 5.


Why is it important to know all this history ? Well, the Apache community is probably one of the most important in the open source landscape and EAI (Enterprise Application Integration)/ESB (Enterprise Service Bus) software like Apache ServiceMix and Apache Camel, together with messaging systems like Apache ActiveMQ, have been interested the community since a quite long time. However, true production-ready solutions were very rare because of the lack of integration of these types of product stacks with Java EE containers. Apache ServiceMix is an ESB and Apache Camel, as an EIP implementation, is pluggable into it. At its origin, ServiceMix was designed to run either on JBI (Java Business Integration) busses or on OSGi platforms. But after having been adopted by the Java Committee Program, the JBI specifications have interested  only Sun Microststems, who provided a reference implementation, while the other majors like IBM, BEA, Oracle, etc. have boycotted them in order to promote their own legacy solutions. Consequently, the JBI support has been removed from ServiceMix and its reference platform became OSGi, which Apache Karaf was one of the preferred implementations.


Okay, so Apache ServiceMix/Apache Camel and, later, Fuse Service Bus/Fuse Mediation Router were available between 2008 and the end of 2012 as follows:

  • In Java SE stand-alone applications.
  • In Spring containers.
  • On OSGi platforms, especially Apache Karaf.
  • In Java EE containers, in a quite tricky way.


Talking about Apache Camel/Fuse Mediation Router, which is our focus here, the simplest way to use it was in Java SE applications. However, this scenario presents several issues as, Camel routes once defined and started, are meant to run indefinitely, for an arbitrary period of time, which might go from hours to weeks or months.  This is not adapted to a Java SE lifecycle which needs a main() method ran explicitly. It is this main() method that instantiates and starts the Camel context, in which the routes are defined. Once started, the Java SE class and its main method will run for ever, until explicitly stopped, which will stop of course the Camel routes as well. Even if a background process may be used in this scenario, such that to mimic a kind of daemon, it’s obvious that the Java SE process livecycle is not suitable to the Camel one.


Camel routes are more appropriated to be ran in application servers, where they start automatically, at the server start time or at the deployment time, without the need to manually start and stop the Camel context, and where they stay active as long as the server is running. Hence the other two solutions, more complicated as they required containers, but more suitable. Spring containers like tc Server, vFabric, etc. as well as OSGi containers like Apache Karaf, are good platform to run Camel routes, but they are however small-scale compared to the ubiquity of the Java EE application servers. Even the fact that some Java EE application servers, like WebSphere and JBoss, have embedded OSGi containers, didn’t change much to this as very few users and projects would use WebSphere or JBoss as OSGi platforms. As for native Java EE containers, the only way to run Camel is through JMX (Java Management eXtension). For example, one could imagine an MBean exposed by the JBoss JMX Console, which contains methods to start and stop the Camel context but, besides being quite tricky, this solution is not fully portable.


In conclusion, besides the great interest of the EIP and Apache Camel/Fuse Mediator Router, it was quite difficult to really use these tools in production-ready services and applications. Entry JBoss Fuse Service Works which is the first Java EE container providing a real integration with Apache Camel/Fuse Mediation Router. Based on JBoss EAP 6, JBoss Service Works is the current releas of JBoss SOA Platform and represents, besides other, a very convenient environment to develop and deploy Camel based services, without having to use neither OSGi sub-containers, nor JMX.

Envoyer à un ami

* champs obligatoires

* champs obligatoires

« Les informations recueillies font l’objet d’un traitement informatique destiné au traitement de votre demande. Le destinataire des données est Simplex Software. Conformément à la loi « informatique et libertés » du 6 janvier 1978 modifiée en 2004, vous bénéficiez d’un droit d’accès et de rectification aux informations qui vous concernent, que vous pouvez exercer en vous adressant à Simplex Software, 26 Allée des Sapins - 95230 Soisy sous Montmorency. Vous pouvez également, pour des motifs légitimes, vous opposer au traitement des données vous concernant. »