Thursday, December 9, 2010

Camel in Action is complete!

So we did it. Camel in Action is headed to the press! Time for beers and all that, but first a little blog post :)

I had to actually search through my mail to find out when I started on this project. Turns out I got involved mid September 2009 which puts the time in about 15 months. Claus started before that so his month count is higher - poor guy ;) So it was a pretty big chunk of time for both of us but not too bad for a technical book I'm told.

We set out to create something that the growing Apache Camel community needed badly - a great reference for newbies and experts alike. I'd like to think we accomplished that goal. Seems the early access readers agree too.

Thanks to all who were involved in producing this book. We had tons of very helpful reviewers, Manning staff, and even multiple foreword writers - there were a lot of people involved in creating this other than Claus or myself. Of course, we officially thanked the folks involved in the acknowledgements section so be sure to look there if you helped out :)

I have yet to see anything other than a PDF copy of the book (which should be released tomorrow) so I'm really looking forward to when the print copies start showing up in 10 days!

Also, feel free to use the "camel50" code for 50% off when ordering through

Now its time to celebrate.

Friday, August 27, 2010

Apache Camel Webinars at FuseSource

As Claus just posted, we are doing two webinars next month on Apache Camel at FuseSource.

  • September 8th - Claus will give an introduction to Apache Camel including: core concepts, EIPs, components, and the community.
  • September 16th - I will go over deployment options for Camel including: embedded Java, Spring, ActiveMQ, ServiceMix (OSGi) and web app. This will include a live demonstration of deploying a Camel application in ServiceMix.
These webinars are interactive so you can ask questions to us directly. Register here and drop in, it will be an interesting show!

Monday, July 12, 2010

Quick load testing with the Camel Dataset component

A pretty common thing I have to do is investigate issues that only occur when load is put on a system. Instead of hand coding message producers to pummel a Camel route or message broker, I've been using the Camel dataset component. I'm not sure many are aware of it but its an incredibly useful and easy to use tool.

For demonstration's sake let say we want to send 10000 messages in a tight loop to a ActiveMQ broker started on the local machine. First we download ActiveMQ

and then start up ActiveMQ


Now we set up a simple Camel app that uses the Dataset component in a Spring XML file (source available here):

<bean id="myDataSet" class="org.apache.camel.component.dataset.SimpleDataSet">
<property name="size" value="10000"/>

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://localhost:61616"/>

<camelContext xmlns="">
<from uri="dataset:myDataSet?produceDelay=-1"/>
<to uri="activemq:myQueue"/>

<from uri="activemq:myQueue"/>
<to uri="file:/tmp"/>

So we first create a SimpleDataSet #1 with a size of 10000. This means that 10000 messages will be sent when we use this is the route. We also need to configure the connection to the ActiveMQ broker #2 that we will be pummeling. Finally, we have a Camel route that sends 10000 messages to a queue named myQueue #3. We also have another route that consumes from the same queue and dumps the message contents to the /tmp directory. You can run this now by issuing mvn camel:run on the command line. You will see output something like:

[pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Apache Camel 2.3.0 (CamelContext: camelContext) started in 1155 millis
[et://myDataSet?produceDelay=-1] et://myDataSet?produceDelay=-1 INFO Sent: 2000 messages so far. Last group took: 2120 millis which is: 943.396 messages per second. average: 943.396
[et://myDataSet?produceDelay=-1] et://myDataSet?produceDelay=-1 INFO Sent: 4000 messages so far. Last group took: 1867 millis which is: 1,071.237 messages per second. average: 1,003.261
[et://myDataSet?produceDelay=-1] et://myDataSet?produceDelay=-1 INFO Sent: 6000 messages so far. Last group took: 2014 millis which is: 993.049 messages per second. average: 999.833
[et://myDataSet?produceDelay=-1] et://myDataSet?produceDelay=-1 INFO Sent: 8000 messages so far. Last group took: 2399 millis which is: 833.681 messages per second. average: 952.381
[et://myDataSet?produceDelay=-1] et://myDataSet?produceDelay=-1 INFO Sent: 10000 messages so far. Last group took: 1741 millis which is: 1,148.765 messages per second. average: 986.096

So this allowed us to quickly (1) set up a producer which sent 10000 messages, (2) consume those messages from the same queue and (3) report what the throughput was during the test.

The source for this example is available at

For more information on the dataset component, see the official Apache Camel documentation at

Thursday, April 1, 2010

Understanding Camel components

We've updated Camel in Action today with 3 new chapters. That brings the total to 11 out of 13 chapters, which means we are getting close :)

One of the chapters is all about Camel components. The list of components in Camel has really exploded over the last few years. Camel ships with 76 components right now and there are dozens more available separately from other community sites. I mean, when presented with most integration scenarios we can easily say

"There's a Camel component for that."

So out of these components, which ones did we choose to cover? To make the content fit into one chapter we covered 11 components in 7 sections:

SectionComponents covered
Working with filesfile, ftp
Asynchronous Messaging using the JMS componentjms
Web Services and the CXF Componentcxf
Networking with the MINA componentmina
Working with databasesjdbc, jpa
In-memory asynchronous messagingseda, vm
Automating taskstimer, quartz

Why these components? Well, we felt that these were the most widely used and thus essential knowledge for any Camel user. Of course, other components are covered elsewhere in the book but not in as much detail as these.

Feel free to check out chapter 7 Understanding components in the latest book update or browse the chapters examples.