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 Video Library
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
View Events Video Library
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
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

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Microservices With Apache Camel and Quarkus (Part 5)
  • Microservices With Apache Camel and Quarkus (Part 3)
  • Microservices With Apache Camel and Quarkus (Part 2)
  • Microservices With Apache Camel and Quarkus

Trending

  • AWS vs. Azure vs. Google Cloud: Comparing the Top Cloud Providers
  • The API-Centric Revolution: Decoding Data Integration in the Age of Microservices and Cloud Computing
  • AI for Web Devs: Project Introduction and Setup
  • Chronicle Services: Low Latency Java Microservices Without Pain
  1. DZone
  2. Coding
  3. Frameworks
  4. Taking Apache Camel for a Ride with Bruce Snyder

Taking Apache Camel for a Ride with Bruce Snyder

Matt Raible user avatar by
Matt Raible
·
Oct. 24, 08 · Interview
Like (0)
Save
Tweet
Share
9.69K Views

Join the DZone community and get the full member experience.

Join For Free

camel is a java api that allows you to do message routing very easily. it implements many of the patterns found in enterprise integration patterns . it doesn't require a container and can be run in any java-based environment. camel has a whole bunch of components - bruce is showing a 6 x 10 grid with a component name in each grid. in other words, there's 60 components that camel can use. examples include: activemq, sql, velocity, file and ibatis.

chris richardson asks "what's left inside of servicemix". why use servicemix if you have camel? servicemix is a container that can run standalone or inside an app server. you can run distributed servicemix as a federated usb. camel is much smaller and lightweight and is really just a java api. servicemix 4 changed from a jbi-based architecture to osgi (based on apache felix). they also expect to create your routes for servicemix 4 with camel instead of xml. to process messages, you can use many different languages: beanshell, javascript, groovy, python, php, ruby, jsp el, ognl, sql, xpath and xquery.

camel has a camelcontext that's similar to spring's applicationcontext . you can initialize it in java and add your routes to it:

camelcontext context = new defaultcamelcontext();
context.addroutes(new myrouterbuilder());
context.start();

or you can initialize it using xml:

<camelcontext xmlns="http://activemq.apache.org/camel/schema/spring">
    <package>com.acme.routes</package>
</camelcontext>

camel's routebuilder contains a fluid api that allows you to define to/from and other criteria. at this point, bruce is showing a number of examples using the java api. he's showing a content based router, a message filter, a splitter, an aggregator, a message translator, a resequencer, a throttler and a delayer.

bruce spent the last 10 minutes doing a demo using eclipse, m2eclipse, the camel-maven-plugin and activemq. it's funny to see a command-line guy like bruce say he can't live w/o m2eclipse. i guess maven's xml isn't so great after all. ;-)

camel is built on top of spring and has good integration. apparently, the camel developers tried to get it added to spring, but the springsource guys didn't want it. coincidentally, spring integration was released about a year later.

camel also allows you to use "beans" and bind them to camel endpoints with annotations. for example:

public class foo {

    @messagedriven (uri="activemq:cheese")
    public void oncheese(string name) {
        ...
    }
}

other annotations include @xpath, @header and @endpointinject.

camel can also be used for bam (business activity monitoring). rather than using routebuilder, you can use activitybuilder to listen for activities and create event notifications.

bruce had quite a few folks show up for this presentation. i had trouble finding a seat because i was late. i think he did a good job of showing what camel is and how you might use it.

from http://raibledesigns.com

Apache Camel

Opinions expressed by DZone contributors are their own.

Related

  • Microservices With Apache Camel and Quarkus (Part 5)
  • Microservices With Apache Camel and Quarkus (Part 3)
  • Microservices With Apache Camel and Quarkus (Part 2)
  • Microservices With Apache Camel and Quarkus

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

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: