Unit testing OSGi Blueprint with Apache Camel made easier

Apache Camel 2.10 is currently in development, and recently Guillaume Nodet added a new camel-test-blueprint component, to make unit testing Camel with OSGi blueprint much easier.

I have then polished the camel-test-blueprint to make it easier to use, and also fix a few glitches etc. So what's the story then? Well camel-test-blueprint, works exactly as the regular camel-test you may be familiar with already.

So all you have to do is to extend the CamelTestSupport class, and override the getBlueprintDescriptor method, and return the path for your OSGi blueprint XML file. Then the rest is the usual story, to add test methods.

The Camel documentation has been updated, and you can find details here.

This is a great step forward for Camel end users who are on the OSGi blueprint wagon, as its becoming easier to develop and unit test along the way. All you have to do is to right click from your editor and run the unit tests as shown in the screenshot below.

JUnit testing Camel with OSGi Blueprint

The Camel Maven archetype camel-archetype-blueprint has been updated and include the test kit out of the box with a sample code. I used this archetype to generate a new project, imported the project into Fuse IDE / Eclipse, and then I opened the unit test source code file, and right clicked -> run as -> JUnit test. This is all standard functionality of Eclipse.

The camel-test-blueprint component will be part of Apache Camel 2.10 release, and as well in the upcoming Fuse Mediation Router 2.9 release (our distribution of Apache Camel).


A rare book

Jonathan and I hear often from our readers of Camel in Action, that the book is great, that it helped them get up and riding the Camel, and so on.

Camel in Action - a rare book, and a rare book cover
The Camel in Action book has now been out there over a year. And over the time readers have been kind to post reviews of the book.

I just spotted the last review on Amazon, which I though was much inline what we have heard people say about the book. Let me just quote that review.
It isn't often that I give a technical book a 5 star rating. This is the exception because it is an exceptional book.

This book is fascinating reading and how often can you say that about a technical reference? As one goes through the material the author always seems to be at the place you need him to be at that moment. You don't get that "now waitaminit" feeling that other books can leave you with when they switch topics.

There are smooth context switches from how one uses the system to how one implements the details and then back up again. This makes it easy to follow and is one of the reasons it is actually fun to read. 

Boy, fun to read, is that ever an exceptional technical book.
If you have spotted it, the above image of the book cover is also rare. In fact it was the first draft of the cover, where the Camel is standing up. However Manning later decide to have the Camel sitting instead, which is the actual used cover. You can see the actual cover on the sidebar of my blog.


EIP Flashcards

FuseSource makes available the EIP patterns as a PDF download.

EIP patterns as PDF download
The design patterns defined in this PDF deck are based on the book Enterprise Integration Patterns (Addison-Wesley). Gregor Hohpe and Bobby Woolf documented their combined experience in the integration space and created this notation, which has since been adopted as the standard for describing integration patterns. Our FuseSource community has found, as an example, a key benefit to this format of standard notations is the efficiency of using the cards to design complex integration routes in a conference room.

The EIP patterns flashcard is available at the Enterprise Integration Patterns page.


FuseSource January Webinar - ActiveMQ with High Availabilty

I am possible a bit late to the game to post this blog, but I wanted to spread the word. FuseSource is having a webinars this month, actually tomorrow on the 19th.

First Scott Cranton is giving a webinar tomorrow about deploying ActiveMQ with High Availability.

Scott Cranton is presenting ActiveMQ with High Availability, and sharing his experience from the trenches, in the upcoming webinar.
This is a topic beyond the basic introduction levels. So great stuff for people there. And believe me Scott have seen this in real life with very large customer installations, such as world leading retailers.

Webinar Title
Deploying Apache ActiveMQ with High Availability

Date: January 19th, 2012
Speaker: Scott Cranton, Principal Solutions Engineer
Time: 11:00AM EST

Webinar Description
Learn how to use open source Apache ActiveMQ for reliable messaging in mission-critical applications where uptime is paramount. This webinar will focus on enterprise deployments where applications need to be available 24x7 without suffering an outage to the messaging system.

We will cover techniques for deploying ActiveMQ with high availability (HA), so your application will survive network outages, hard disk crashes or machine losses. Focus will be on configuring Master/Slave a Network of Brokers, and explaining what's happening within ActiveMQ. We will also look at using ActiveMQ in global organizations that span many different geographical locations. Finally, we will talk about how to configure ActiveMQ so that it can scale to support thousands of concurrent connections, queues and topics.

This webinar will include a live demo and Q & A session.

You can register for the webinar from this page.

FuseSource has previous held webinars in our archives. So feel free to take a look and watch any webinar at your leisure.


FuseSource has professional Camel documentation

Eric Johnson from the FuseSource documentation team, recently blogged about the fact, we from FuseSource, have plenty of professional documentation.

Quoting Eric
I find it frustrating that so few people, people who use our products, realize the amount of documentation FuseSource offers on their products. I was talking to some users the other day who were shocked to discover that FuseSource offerers Javadoc for Fuse ESB. It rapidly becomes clear that people who complain about our documentation are usually complaining about the documentation they find at the Apache projects that make up the core of our offerings. I understand their frustration with the information on the Apache sites. It is often outdated, confusing, and hard to search. It is written by ninjas for other ninjas. The FuseSource Documentation team writes professional, versioned content targeted at more typical corporate IT professionals. We strive to make the content task oriented and relevant. We use better sample code, vet the content for accuracy, and organize it so that it can be searched effectively. Our documentation can be found at: It is available for free and, hopefully, is useful. We love to get feedback, so if you find issues or have ideas about how we can improve the content, leave feedback in the comment forms on the bottom of the pages. One of the writers will get back to you pretty quick.

I can second Eric's observations. The level and quality of the documentation of the four Apache projects, can at best be used as a reference material.

As Eric says, FuseSource, have a professional team, who help writes documentation you cannot find at Apache, such as migration guides, performance tuning guides, deployment guides, transaction guides, management guides, and an operators handbook, etc. You may find pieces here and there scattered in the Apache documentation.

For example, when people ask me, what is Apache Camel, and how do they get started? Then I usually point them to an article - Open Source Integration with Apache Camel and How Fuse IDE Can Help written by Jonathan Anstey. This article introduces you to Camel, tells how its related to Enterprise Integration Patterns, shows a high level architecture overview, and talks about some of its concepts. And tie it all together with a sample use-case, with source code, that are explained.

Another good source is the chapter 1 (free) of the Camel in Action book. Jonathan is a co-author of this book, together with me.

There is of course also the FuseSource Mediation Router (Camel) introduction documentation as well.


Apache Camel 2.9 Released - Top 10 Changes

On the last day of 2011 the Apache Camel artifacts just managed to be pushed to the central maven repo, just shy 1.5 hours before champagne bottles was cracked and we entered 2012.

The 2.9 release is a record breaking release with about 500 JIRA tickets resolved since the 2.8 released 5 months ago.

Here is a break down of 10 of the most noticeable improvements and new features:

JAR dependencies reduced. The camel-core JAR now only depend on the API from slf4j. On top of that about 15 components, no longer depends on Spring JARs.

I have previously blogged about this.

The Simple language has been overhauled and has a much improved syntax parser, which gives precise error details, what is wrong. You can now also have embedded functions inside functions as well. And we have unary operators, such as ++ to easily increment counters. I also started experimenting with ternary operators, so expect Conditional and the Elvis operator to be introduced in the future :)

I have previously blogged about this.

The Bean Component has been much improved as well. Now you can define bindings explicit in the method name option, to fully 100% decouple your bean code from Camel, when using more complicated bindings. Likewise you can pass in values such as literals, numbers, booleans etc as well. The bean component can now also invoke static methods directly, as well invoking private class beans if an interface exists.

I have previously blogged about this.

Splitting big XML files in a streaming mode with low memory footprint is now possible. There is a tokenizer solution, that is pure String based by scanning tokens. And another solution to use the StAX and JAXB APIs. The former requires no JAXB bindings, as required by the latter solution.

I have previously blogged about these two solutions [1] and [2].

More cloud components. We now have 2 new AWS components for Simple Email Service, and Simple DB. There is also a new JClouds component.

Using request-reply over JMS with fixed reply queues now supports a new exclusive option which performs faster, than the default assumed shared queue. Likewise the JMS consumer supports a new asyncConsumer option, to allow the JMS consumer to leverage the asynchronous non-blocking routing engine. All good stuff that if enabled can make JMS goes faster under certain use-cases.

Added a new number of JMX annotations to allow custom components to easily expose custom JMX attributes and operations. We also have JMX load statistics on the ManagedCamelContext MBean which is similar to the unix top command, which has average load stats for the last 1-minute, 5-minutes, and 15-minutes.

The camel-cxf component now supports OSGi blueprint configuration for the CXF-RS as well.

There is a number of new Apache Karaf Camel commands for further managing your Camel applications from the command shell.

And as usual there is a lot of minor improvements and bug fixes as well. For example the file/ftp components now support the sendEmptyMessageWhenIdle to .. yeah send an empty message when there was no files to poll. Likewise the script and language components now more easily allow to load scripts from file/classpath. And the Camel Test Kit, now have more juice for swapping endpoints before unit testing, which makes it easier to swap real endpoints with mocks and whatnot without touching your route code in the tests.

And we have as usual upgraded to the latest and greatest of 3rd party libraries, such as Apache CXF 2.5.1, Groovy 1.8.5, Jackson 1.9.2, AWS 1.2.12, Spring 3.0.6, and JPA2 etc.

You can see more details at the 2.9 release notes, such as details about other improvements and bug fixes etc.


Apache Camel - 2011 in Numbers

The last couple of years I did this blog post about numbers for 2010, and 2009, so I thought I should do it again this year.

Just to do a quick post on some of the numbers for the Apache Camel project in year 2011.

Number of releases in 2011: Camel 2.x = 12 releases (incl. 1 RC release).
Number of posts on Camel user forum in 2011: 8315 (+1393 over last year)
Number of commits in 2011: 4926 (+990 over last year)
Total number of tickets created at end of 2011: 4844
Number of tickets created in 2011: 1367 (where as 189 are still unresolved).
Number of tickets resolved in 2011: 1286
Number of committers doing commits in 2011: 26 (+8 over last year) (source: git shortlog --after 2010-12-31 --before 2012-01-01 -ns).

I am sure you can dig more numbers if you got the time to hunt them down.