DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Spring Integration Project Creation VS. Apache Camel Project Creation

Spring Integration Project Creation VS. Apache Camel Project Creation

Claus Ibsen user avatar by
Claus Ibsen
·
Apr. 18, 12 · Interview
Like (0)
Save
Tweet
Share
12.85K Views

Join the DZone community and get the full member experience.

Join For Free
One of the blogs I follow is from Gunnar Hillert, whom back in 2009 discovered Camel and wrote a nice blog entry. He also did some investigation of Camel alternatives as well. One of the alternatives is Spring Integration. Gunnar has since joined VMWare to be part of the Spring team.

So this morning I read the new blog post by Gunnar on how to create a Spring Integration project in STS tooling, which is posted here. The STS creates a simple out of the box example, that provides the following XML (in screenshot) as the main logic. Take a moment to see if you can figure out what it does. And then compare to the equivalent Camel example below.

Spring Integration - Simple Example created by STS tooling
And here is the Camel example using XML as well:

Apache Camel - The same example as above
Having both screenshots, I guess you can figure out that the example:

  1. reads input from the console
  2. upper case the input
  3. and prints it back on the console

This example will be provided out of the box in the upcoming Apache Camel 2.10, in the examples/camel-example-console directory. You can see the source code here.

You can run it from command line using Maven
mvn compile exec:java
And then press ctrl + c to stop the application.

Running the Camel example from command line

Or you can run it from within your IDE of choice, such as IDEA / Eclipse / FuseIDE by running the CamelConsoleMain class. For example as the screenshot shows below from IDEA.

Running the example from your editor such as IDEA

To create a new Camel project you can use the Camel Maven archetypes. Or use Fuse IDE which has a wizard just like STS to create a new Camel project.

A few notes about Camel. The example uses Spring and XML, however Camel can be used without Spring at all. We could use pure Java and define the Camel route in a Java class. You can also use Scala. And for XML we could also have used OSGi Blueprint.

In the example we use the built-in Simple language to upper case the input. You can chose to use more powerful dynamic languages such as Groovy, OGNL, Mvel, JavaScript etc as well.

With Camel you simply have more choices, and dont have to use XML at all.
Apache Camel Spring Integration Spring Framework Virtual screening Integration

Published at DZone with permission of Claus Ibsen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Custom Validators in Quarkus
  • DevOps vs Agile: Which Approach Will Win the Battle for Efficiency?
  • What Is API-First?
  • Solving the Kubernetes Security Puzzle

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: