0% found this document useful (0 votes)
114 views3 pages

Integration Framework Comparison - Spring Integration, Mule ESB or Apache Camel

The document compares three integration frameworks: Spring Integration, Mule ESB, and Apache Camel. It discusses their similarities, including that they all implement Enterprise Integration Patterns (EIPs) and offer a standardized way to integrate applications using different technologies and data formats. The document also lists criteria for comparing the frameworks, such as open source, architecture, testability, deployment, popularity, support, and domain-specific languages. Overall, the frameworks have many similarities in their goals and approaches, but differ in specific features, community support, and commercial support options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views3 pages

Integration Framework Comparison - Spring Integration, Mule ESB or Apache Camel

The document compares three integration frameworks: Spring Integration, Mule ESB, and Apache Camel. It discusses their similarities, including that they all implement Enterprise Integration Patterns (EIPs) and offer a standardized way to integrate applications using different technologies and data formats. The document also lists criteria for comparing the frameworks, such as open source, architecture, testability, deployment, popularity, support, and domain-specific languages. Overall, the frameworks have many similarities in their goals and approaches, but differ in specific features, community support, and commercial support options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Integration Framework Comparison - Spring Integration, Mule ESB or ... https://www.javacodegeeks.com/2012/03/integration-framework-compar...

Home » Java » Enterprise Java » Integration Framework Comparison – Spring Integration, Mule ESB or Apache Camel

Kai Waehner works as consultant. His main area of expertise lies within the fields of Java EE, SOA, Cloud Computing, BPM, Big Data,
and Enterprise Architecture Management. He is speaker at international IT conferences such as JavaOne, ApacheCon or OOP, writes
articles for professional journals, and shares his experiences with new technologies on his blog.

Posted by: Kai Waehner in Enterprise Java March 13th, 2012 5 Comments

Data exchanges between companies increase a lot. The number of applications which
must be integrated increases, too. The interfaces use different technologies, protocols
and data formats. Nevertheless, the integration of these applications shall be
modeled in a standardized way, realized efficiently and supported by
automatic tests.

Three integration frameworks are available in the JVM environment, which fulfil these
requirements: Spring Integration, Mule ESB and Apache Camel. They implement
the well-known Enteprise Integration Patterns (EIP, http://www.eaipatterns.com) and
therefore offer a standardized, domain-specific language to integrate applications.

These integration frameworks can be used in almost every integration project within
the JVM environment – no matter which technologies, transport protocols or data
Insiders are already enjoying weekly updates and
formats are used. All integration projects can be realized in a consistent way without
complimentary whitepapers!
redundant boilerplate code.
This article compares all three alternatives and discusses their pros and cons. If you want to know, when to use a more powerful Enterprise Join them now to gain exclusive
Service Bus (ESB) instead of one of these lightweight integration frameworks, then you should read this blog post: http://www.kai-
access to the latest news in the Java world, as
waehner.de/blog/2011/06/02/when-to-use-apache-camel/ (it explains when to use Apache Camel, but the title could also be „When to use a
well as insights about Android, Scala, Groovy and
lightweight integration framework“).
other related technologies.

Email address:
Comparison Criteria
Several criteria can be used to compare these three integration frameworks:

Open source Sign up

Basic concepts / architecture


Testability
Deployment
Popularity
Commercial support With 1,240,600 monthly
IDE-Support unique visitors and over
500 authors we are
Errorhandling placed among the top Java
Monitoring related sites around.
Constantly being on the
Enterprise readiness lookout for partners; we
Domain specific language (DSL) encourage you to join us.
So If you have a blog with
Number of components for interfaces, technologies and protocols unique and interesting content then you should
Expandability check out our JCG partners program. You can also
be a guest writer for Java Code Geeks and hone
your writing skills!
Similarities
All three frameworks have many similarities. Therefore, many of the above comparison criteria are even! All implement the EIPs and offer
a consistent model and messaging architecture to integrate several technologies. No matter which technologies you have to use,
you always do it the same way, i.e. same syntax, same API, same automatic tests. The only difference is the the configuration of each
endpoint (e.g. JMS needs a queue name while JDBC needs a database connection url). IMO, this is the most significant feature. Each
framework uses different names, but the idea is the same. For instance, „Camel routes“ are equivalent to „Mule flows“, „Camel components“
are called „adapters“ in Spring Integration.

1 of 5 3/14/2018, 2:16 PM
Integration Framework Comparison - Spring Integration, Mule ESB or ... https://www.javacodegeeks.com/2012/03/integration-framework-compar...

Besides, several other similarities exists, which differ from heavyweight ESBs. You just have to add some libraries to your classpath.
Therefore, you can use each framework everywhere in the JVM environment. No matter if your project is a Java SE standalone application, or
if you want to deploy it to a web container (e.g. Tomcat), JEE application server (e.g. Glassfish), OSGi container or even to the cloud. Just add
the libraries, do some simple configuration, and you are done. Then you can start implementing your integration stuff (routing,
transformation, and so on).

All three frameworks are open source and offer familiar, public features such as source code, forums, mailing lists, issue tracking and
voting for new features. Good communities write documentation, blogs and tutorials (IMO Apache Camel has the most noticeable community).
Only the number of released books could be better for all three. Commercial support is available via different vendors:

Spring Integration: SpringSource (http://www.springsource.com)


Mule ESB: MuleSoft (http://www.mulesoft.org)
Apache Camel: FuseSource (http://fusesource.com) and Talend (http://www.talend.com)

IDE support is very good, even visual designers are available for all three alternatives to model integration problems (and let them generate
the code). Each of the frameworks is enterprise ready, because all offer required features such as error handling, automatic testing,
transactions, multithreading, scalability and monitoring.

Differences
If you know one of these frameworks, you can learn the others very easily due to their same concepts and many other similarities. Next, let’s
discuss their differences to be able to decide when to use which one. The two most important differences are the number of supported
technologies and the used DSL(s). Thus, I will concentrate especially on these two criteria in the following. I will use code snippets
implementing the well-known EIP „Content-based Router“ in all examples. Judge for yourself, which one you prefer.

Spring Integration
Spring Integration is based on the well-known Spring project and extends the programming model with integration support. You can use
Spring features such as dependency injection, transactions or security as you do in other Spring projects.

Spring Integration is awesome, if you already have got a Spring project and need to add some integration stuff. It is almost no effort to learn
Spring Integration if you know Spring itself. Nevertheless, Spring Integration only offers very rudimenary support for technologies – just „basic
stuff“ such as File, FTP, JMS, TCP, HTTP or Web Services. Mule and Apache Camel offer many, many further components!
Integrations are implemented by writing a lot of XML code (without a real DSL), as you can see in the following code snippet:

01 <file:inbound‐channel‐adapter
02 id=”incomingOrders”
03 directory=”file:incomingOrders”/>
04
05 <payload‐type‐router input‐channel=”incomingOrders”>
06 <mapping type=”com.kw.DvdOrder” channel=”dvdOrders” />
07 <mapping type=”com.kw.VideogameOrder”
08 channel=”videogameOrders” />
09 <mapping type=”com.kw.OtherOrder” channel=”otherOrders” />
10
11 </payload‐type‐router>
12
13 <file:outbound‐channel‐adapter
14 id=”dvdOrders”
15 directory=”dvdOrders”/>
16
17 <jms:outbound‐channel‐adapter
18 id=”videogamesOrders”
19 destination=”videogameOrdersQueue”
20 channel=”videogamesOrders”/>
21
22 <logging‐channel‐adapter id=”otherOrders” level=”INFO”/>

You can also use Java code and annotations for some stuff, but in the end, you need a lot of XML. Honestly, I do not like too much XML
declaration. It is fine for configuration (such as JMS connection factories), but not for complex integration logic. At least, it should be a DSL
with better readability, but more complex Spring Integration examples are really tough to read.
Besides, the visual designer for Eclipse (called integration graph) is ok, but not as good and intuitive as its competitors. Therefore, I would
only use Spring Integration if I already have got an existing Spring project and must just add some integration logic requiring only „basic
technologies“ such as File, FTP, JMS or JDBC.

Mule ESB
Mule ESB is – as the name suggests – a full ESB including several additional features instead of just an integration framework (you can
compare it to Apache ServiceMix which is an ESB based on Apache Camel). Nevertheless, Mule can be use as lightweight integration
framework, too – by just not adding and using any additional features besides the EIP integration stuff. As Spring Integration, Mule only offers
a XML DSL. At least, it is much easier to read than Spring Integration, in my opinion. Mule Studio offers a very good and intuitive visual
designer. Compare the following code snippet to the Spring integration code from above. It is more like a DSL than Spring Integration. This
matters if the integration logic is more complex.

01 <flow name=”muleFlow”>
02 <file:inbound‐endpoint path=”incomingOrders”/>
03 <choice>
04 <when expression=”payload instanceof com.kw.DvdOrder”
05 evaluator=”groovy”>
06 <file:outbound‐endpoint path=”incoming/dvdOrders”/>
07 </when>
08 <when expression=”payload instanceof com.kw.DvdOrder”
09 evaluator=”groovy”>
10 <jms:outbound‐endpoint
11 queue=”videogameOrdersQueue”/>
12 </when>
13 <otherwise>
14 <logger level=”INFO”/>
15 </otherwise>
16 </choice>
17 </flow>

2 of 5 3/14/2018, 2:16 PM
Integration Framework Comparison - Spring Integration, Mule ESB or ... https://www.javacodegeeks.com/2012/03/integration-framework-compar...

The major advantage of Mule is some very interesting connectors to important proprietary interfaces such as SAP, Tibco
Rendevous, Oracle Siebel CRM, Paypal or IBM’s CICS Transaction Gateway. If your integration project requires some of these
connectors, then I would probably choose Mule!

A disadvantage for some projects might be that Mule says no to OSGi: http://blogs.mulesoft.org/osgi-no-thanks/

Apache Camel
Apache Camel is almost identical to Mule. It offers many, many components (even more than Mule) for almost every technology you could
think of. If there is no component available, you can create your own component very easily starting with a Maven archetype! If you are a
Spring guy: Camel has awesome Spring integration, too. As the other two, it offers a XML DSL:

01 <route>
02 <from uri=”file:incomingOrders”/>
03 <choice>
04 <when>
05 <simple>${in.header.type} is ‘com.kw.DvdOrder’</simple>
06 <to uri=”file:incoming/dvdOrders”/>
07 </when>
08 <when>
09 <simple>${in.header.type} is ‘com.kw.VideogameOrder’
10 </simple>
11 <to uri=”jms:videogameOrdersQueue”/>
12 </when>
13 <otherwise>
14 <to uri=”log:OtherOrders”/>
15 </otherwise>
16 </choice>
17 </route>

Readability is better than Spring Integration and almost identical to Mule. Besides, a very good (but commercial) visual designer called Fuse
IDE is available by FuseSource – generating XML DSL code. Nevertheless, it is a lot of XML, no matter if you use a visual designer or just your
xml editor. Personally, I do not like this.

Therefore, let’s show you another awesome feature: Apache Camel also offers DSLs for Java, Groovy and Scala. You do not have to
write so much ugly XML. Personally, I prefer using one of these fluent DSLs instead XML for integration logic. I only do configuration stuff
such as JMS connection factories or JDBC properties using XML. Here you can see the same example using a Java DSL code snippet:

1 from(“file:incomingOrders “)
2 .choice()
3 .when(body().isInstanceOf(com.kw.DvdOrder.class))
4 .to(“file:incoming/dvdOrders”)
5 .when(body().isInstanceOf(com.kw.VideogameOrder.class))
6 .to(“jms:videogameOrdersQueue “)
7 .otherwise()
8 .to(“mock:OtherOrders “);

The fluent programming DSLs are very easy to read (even in more complex examples). Besides, these programming DSLs have better IDE
support than XML (code completion, refactoring, etc.). Due to these awesome fluent DSLs, I would always use Apache Camel, if I do not need
some of Mule’s excellent connectors to proprietary products. Due to its very good integration to Spring, I would even prefer Apache Camel to
Spring Integration in most use cases.

By the way: Talend offers a visual designer generating Java DSL code, but it generates a lot of boilerplate code and does not allow vice-versa
editing (i.e. you cannot edit the generated code). This is a no-go criteria and has to be fixed soon (hopefully)!

And the winner is…


… all three integration frameworks, because they are all lightweight and easy to use – even for complex integration projects. It is awesome to
integrate several different technologies by always using the same syntax and concepts – including very good testing support.

My personal favorite is Apache Camel due to its awesome Java, Groovy and Scala DSLs, combined with many supported
technologies. I would only use Mule if I need some of its unique connectors to proprietary products. I would only use Spring Integration in an
existing Spring project and if I only need to integrate „basic technologies“ such as FTP or JMS. Nevertheless: No matter which of these
lightweight integration frameworks you choose, you will have much fun realizing complex integration projects easily with low efforts.
Remember: Often, a fat ESB has too much functionality, and therefore too much, unnecessary complexity and efforts. Use the right tool for
the right job!

Reference: Spoilt for Choice: Which Integration Framework to use – Spring Integration, Mule ESB or Apache Camel? from our JCG
partner Kai Wahner at the Blog about Java EE / SOA / Cloud Computing blog.

Tagged with:

3 of 5 3/14/2018, 2:16 PM

You might also like