2012-12-29

Camel 2.11 - HTTP proxy routes with url rewriting functionality

In the upcoming Apache Camel 2.11 release I have recently added support for plugging in custom url rewrite implementations to HTTP based routes (http, http4, jetty). This allows people to control the url mappings, when you use Camel to proxy/bridge HTTP routes.

For example suppose you need to proxy a legacy HTTP service and plugin a strategy for mapping the urls. This is now much easier with Camel 2.11. There is a new option urlRewrite added to the various HTTP components, to plugin a custom url rewriter.

For example having a http proxy route as shown, where we use the new urlRewrite option on the http producer endpoint.


from("jetty:http://localhost:{{port}}/myapp?matchOnUriPrefix=true")
    .to("jetty:http://somewhere:{{port2}}/myapp2?bridgeEndpoint=true&throwExceptionOnFailure=false&urlRewrite=#myRewrite");


In a nutshell you can implement a custom strategy by implementing the UrlRewrite interface, as shown below. As this is from an unit test, we just replace yahoo to google in the url (yes its not a real-life applicable example).


public class GoogleUrlRewrite implements UrlRewrite {

  @Override
  public String rewrite(String url, String relativeUrl, Producer producer) {
      return url.replaceAll("yahoo", "google");
  }
}

In the rewrite method Camel provides you with the absolute url (eg including scheme:host:port/path?query) or a relative url which is the offset from the uri configured in the route (see further below).

However it all gives you the full power to control the url mappings, and even return a new absolute url. If you return null, then the default strategy is used, which is a 1:1 url mapping.

That is not all there is also a new component

Introducing the new camel-urlrewrite component

The new camel-urlrewrite component is a implementation of the new url rewrite plugin based on the UrlRewriteFilter project. This project has strong support for specifying your rewrite strategies as rules, and have its engine evaluate the rules.

For example we can have N+ rules in the url rewrite XML configuration file. In the example below we have a rule to rewrite urls to adapt to a legacy system which is using JSP.


<urlrewrite>

  <rule>
    <from>/products/([0-9]+)</from>
    <to>/products/index.jsp?product_id=$1</to>
  </rule>

</urlrewrite>


This project has even support for Apache mod_rewrite styles which allow you to define rules as you would do with the Apache HTTP server. Though if you are not familiar with the mod_rewrite style then its dense and takes some time to understand - but very powerful.

All this is documented at the camel-urlrewrite component page with examples. And if you want to look for more, then checking the unit tests source code is also a good way to learn more.

I encourage you to take a look at the new camel-urlrewrite page as it has full examples and more details, that what I have outlined in this short blog.


Happy new-year and see you in 2013.

2012-11-28

Interview with me in Danish IT magazine

A month ago I was interviewed for the Danish IT magazine Prosabladet. Today the magazine is online.

Image from Prosa magazine December 2012.
Though non Danish readers can enjoy the photo above which my wife Christina took. Its from my home office, with our dog Bambi on the lap. Bambi is my trusty companion at work every day in the office.

The article is online in Prosa December 2012 magazine at page 30.

I would like to thank Dan Mygind for the interview. It was a pleasure to talk with him for 1.5 - 2 hours, despite the target was 30 minutes. Yeah I guess I like to talk :)

As part of the interview I was asked to pick a comedy from xkcd, and among the many great ones, I chose this one - the license plate.

(c) image from xkcd.com

2012-11-27

Camel is back in Akka 2.1

When the Akka project was in its early days, Martin Krasser (@mrt1nz), developed what became the akka-camel module, to integrate these two marvelous projects.

Since then years has passed, and its great to see that the Akka community have stepped up and have more people leading the akka-camel module. So thanks to Raymond Roestenburg (co-author of Akka in Action) and Piotr Gabryanczyk (@piotrga) the akka-camel module is fully up to date, and top-notch ready for the Akka 2.1 release.

You can read more details from a recent blog post on let it crash.

2012-10-29

Webinar - Building superior integrated applications with open source Apache Camel

I am scheduled to host a free webinar on building integrated applications using Apache Camel.

Date: November 6th, 2012 (moved due Sandy hurricane)
Time: 3:00 PM (Central European Time) - 10:00 AM (EDT)
Duration: 1h15m

This webinar will show you how to build integrated applications with open source Apache Camel. Camel is one of the most frequently downloaded projects, and it is changing the way teams approach integration. The webinar will start with the basics, continue with examples and how to get started, and conclude with live demo. We will cover
  • Enterprise Integration Patterns
  • Domain Specific Languages
  • Maven and Eclipse tooling
  • Java, Spring, OSGi Blueprint, Scala and Groovy
  • Deployment options
  • Extending Camel by building custom Components
  • Q and A
Before we open for QA at the end of the session, we will share links where you can go and read and learn more about Camel. Don’t miss this informative session!

You can register for the webinar at this link.

2012-10-24

Apache Camel 2.11 - Neo4j and more new components

As usual the Camel community continues to be very active. For the upcoming Camel 2.11 release we have already five new components in the works

All five components started by members of the community, and not by people from the Camel team. For example the camel-neo4j, and camel-couchdb components is kindly donated to ASF by Stephen Samuel. Bilgin Ibryam contributed the camel-cmis component. And Cedric Vidal donated the camel-elastichsearch component. And lastly Scott Sullivan donated the camel-sjms component. 

Since then Scott and Bilgin has been invited into the Camel team, and both are Camel committers today. Scott will continue improved and work on camel-sjms. At this time we are looking for people who wanna give the current code a test-spin. It does take some time to harden this component to become as stable and good as the current camel-jms component. We anticipate this is ongoing work over the next couple of Camel releases.

You can click on the links in the bulleted list to get to the Camel documentation for each of these components, which has some sample code as well.

Also expect much improved CDI support from Camel in 2.11.

The current in-progress release notes of changes in Camel 2.11 can be seen here.

Thanks a lot to the very active Camel community and for people taking up the time to write components that benefit all of us. Keep up the great work.


And in case you did not know, Apache Camel comes with a lot of components out of the box. The screenshot below is a directory listing from my laptop with the trunk code.

Camel Components Galore

PS: There is 133 components.


2012-10-10

When did Apache Camel have retry?

Ansgar Konermann asked me on twitter when Apache Camel had retry functionality (eg a common use-case is to retry in case of a failure).
@davsclaus since when/which version does Camel support retry processing? Spring Integration added it recently.
So I had a peak in the source code and the commits logs reveals the following

commit d0cba2ad2abda2a4e6a18b29a43f86405452f031
Author: James Strachan
Date:   Wed Mar 21 09:56:11 2007 +0000
    added an initial implementation of Dead Letter Channel
   
    git-svn-id: https://svn.apache.org/repos/asf/activemq/camel/trunk@520823 13f79535-47bb-0310-9956-ffa450edef68
James added support for redelivery on the initial Dead Letter Channel in Camel 1.0. So the answer to this question is that Apache Camel came with this functionality out of the box from the very first release. This just makes the first release even more impressive, than I have previously blogged about.

In Camel 1.1 James improved the error handler to add support for exception clauses (eg the onException) so you have fine grained redelivery policies. For example to instruct IOException to have longer and more redelivery attempts, and have your MyBusinessException to not redeliver at all.


That came as early as Camel 1.1. Impressive.

We have since of course further improved error handling and retry/redeliver functionality in Camel. For example you can configure whether Camel should block or use non-blocking while waiting until next redelivery attempt is being triggered.

Another functionality that I remember we (the Camel team) have discussed for a long time how to implement and provide in Camel is graceful shutdown. It turns out its much easier to startup an application than it is to stop/shutdown the application in a reliable manner.

So I took a stab at implementing this and it was provided in the Camel 2.2 release. That is nearly 3 years ago.

Author: Claus Ibsen
Date:   Sun Dec 20 12:27:04 2009 +0000
    CAMEL-1483: Camel now uses graceful shutdown when shutting down.
   
    git-svn-id: https://svn.apache.org/repos/asf/camel/trunk@892587 13f79535-47bb-0310-9956-ffa450edef68
Oh and if you want you can alter the redelivery settings at runtime using JMX. For example to adjust intervals etc. It can all be adjusted.


2012-10-08

Apache ActiveMQ 5.7.0 Released

Today the Apache ActiveMQ team announced the immediate release of Apache ActiveMQ 5.7.0.


In this release I had a more active role than I usually has. So its with great please to see a release come out.

Dejan has posted some highlights of the 5.7.0 release at his blog. Among others is the official support for Java 7, and inclusion of the latest Camel 2.10.x release.

I will continue to help work on ActiveMQ and take on some of the things we have learned over the years from Camel to ActiveMQ. For example I plan to work on enlisting all the threads pool that are in use in the JMX registry, so you can gain better runtime insights into the threading usages.
In the 5.7.0 release I helped improved the thread names to be consistent and start with ActiveMQ. This should help people to quicker identify threads by its name.

There is much more work planned for ActiveMQ 5.8.0, for example we would like to reduce the dependencies on activemq-core, and move code into new separate modules. This allows people to better slice and dice how they want their ActiveMQ deployments.

And I plan to take a look at the ActiveMQ JIRA tracker, there is some low-hanging fruits in there, as well some older tickets which needs a bit attention.


2012-08-24

OSGi deployment made easy with FAB

If I had a dollar each time people had a challenge with OSGi deployments ... I could solve the finance crisis in Europe. Okay I am of course exaggerating; but there is a grain of truth in there ;)

So if you are a developer who wants to be productive, and be able to go home on time, and drink beer with your friends, play sports, and generally have fun and be happy ... then read on.

So to understand what FAB is and why it can make your life easier, then I refer you to the following material.

A FAB (Fuse Bundles) is basically a new way of deploying applications into an OSGi container that can make your life a whole lot easier. This technology has been developed by my engineering colleagues at FuseSource and is open sourced at Github, (ASL 2.0 licensed)

Fintan Bolton and his video team have created 2 new excellent introduction videos about FAB.
To go along the videos we have documentation at the Fuse Fabric website. I encourage you to read the material, as its in the minds of James Strachan, who is a driving force behind FAB.
FAB comes out of the box in the new Fuse ESB Enterprise product, however as FAB is open source and freely available, you can use it in general purpose containers such as Apache ServiceMix or Apache Karaf. 

At github there is a number of examples with full source code, that is also provided out of the box with the Fuse ESB Enterprise product. 


2012-08-20

Introduction to Fuse ESB Enterprise Video

We at FuseSource have created a 5 minute video that shows a rundown of some of the highlights of the new Fuse ESB Enterprise release.


The video can be freely played from vimeo (no registration etc.) and last 5 minutes.
You can also find material about Fuse ESB Enterprise on the FuseSource website.

2012-08-17

Olympics Image Loader powered by Apache Camel

I have been on vacation for 3 weeks during the Olympics. So I missed most of it. Just got back in time for the finals of the football and basketball games on the last days. My vacation was really off the beaten track with no wifi or TVs. Just old fashioned relaxation and books.

In the mean time Bilgin Ibryam, from the Camel team, has been following the olympics. He created a little web application that displayed images related to the olympic games. He wrote a great blog post where he taks through how he did that. Its well worth a read.

Image from Bilgins blog, showing a preview of the website
The source code for the project is hosted on github. There is link and further explanations on Bilgins blog entry. So go there and read more.


2012-07-05

Apache Camel 2.10 Released

The Apache Camel 2.10 release is now available for download from Apache and for Maven users in central maven repo.
Apache Camel reaches impressive 2.10 release
The Camel 2.10 release marks a major milestone, not only, its the 10th release on the 2.x baseline, but this release officially supports Java 7. The Camel team have worked hard to ensure this release works well on both Java 6 and 7; which hasn't been a trivial task to ensure. Most noticeably is the fact that Java6 and 7 JRE ships with different versions of JAXB that were not immediately compatible. 

Spring 3.1 is also official supported, and we have a dedicate test suite running on the Apache CI servers doing a full test run using Spring 3.1.

The Camel test kit have been improved by moving the Spring support into a new camel-test-spring component, which means camel-test is a pure Java based test kit (for non Spring users). There is great news for OSGi Blueprint users, as we have introduced a new camel-test-blueprint component for easy unit test with OSGi Blueprint. I have previously blogged about this.

We have also empowered the Camel test kit by making it easier to stub endpoints, or use the auto mock functionality, which now makes it even easier to skip sending to the target endpoint, using the new isMockEndpointsAndSkip method from CamelTestSupport.

The Camel Maven Archetypes got some love. We improved the blueprint archetype which now leverages the new camel-test-blueprint for unit testing. Likewise the camel:run plugin supports running Blueprint projects as well. The java archetype now creates a pure java project (without Spring). And for Scala enthusiasts we have new archetypes for creating new Scala based components and data formats. Also the archetypes now generates a sample unit test as well.

For managing Camel applications with JMX we have improved this to make it much easier to control and lock down the JMX namings of your Camel apps. I have previously blogged about this in detail. Likewise we have ensured that all the Camel EIPs is enlisted in JMX and offers utilization statistics. And we now have aggregate route statistics on the CamelContextMBean for all your routes.

For people using the file and/or ftp component, we now allow you to bridge exceptions happening when trying to pickup new files with the regular Camel error handler from your routes. This can now be done easily by enabling the consumer.bridgeErrorHandler option.

We also now allows you to configure a shared thread pool for your file/ftp routes (consumers), using the new scheduledExecutorService option. This can reduce the number of threads used in your JVM, if you have a lot of file based routes.

For people using Spring property placeholders, we can now bridge to that from Camel, using the new BridgePropertyPlaceholderConfigurer bean which means you do not have to explicit setup Camel property placeholder as well. The caveat is that you must define this as a Spring as Spring Framework is not flexible allowing 3rd parties to integrate more seamless with its property resolver.

So I have saved the best for the last. The Camel community continues to kick-ass, and for this release we have a record high of 18 new components. For example we now support dynamoDB in the AWS components. We also now supports the popular MongoDB database, and you can have fun with the new Twitter and websocket components. There is also a new component for integration with Spring Batch. And if you need CSV / flatfile support then BeanIO is worth a look as well.

And really existing is the new camel-cdi component which we will continue to expand.

The 2.10 release notes have more details whats included, as well a list of all the new components.

The Camel team will continue with Camel 2.11, and keep doing patch releases as well. However with 2.10 being released, then we will slowdown on the 2.8 release, to comply with our statement that we active support the last 2 minor release branches.


2012-07-02

Happy Birthday Apache Camel - Camel turns five years today

Happy 5 years birthday Apache Camel.
Apache Camel turns 5 years today
When does a software project have its birthday, is it the day of its
  • first commit
  • public announcement
  • any first 0.x release (pre 1.0)
  • or at the very first 1.0 release
Well today is July 2th 2012, and 5 years ago Apache Camel 1.0 was released and published to Maven Central.

Apache Camel 1.0 Release at Maven Central
So lets celebrate the birthday of Apache Camel today by marking its been 5 years since the very first 1.0 release hit the streets. The Camel team created a fantastic first release, which I blogged about previously.

Apache Camel 1.0 Release
Just to complete the bullets, so the first commit was done by one of the founders, James Strachan, on March 19th 2007. And its no wonder that it was James who made the first public announcement of Apache Camel on his blog on May 15th 2007. And 3 months later as we know it, Camel 1.0 was released on July 2th 2007.

Over the course of time the Camel team have released many Camel releases.
  • A total of 11 release of the Camel 1.x series.
  • And so far 23 releases (and 3 milestones, and 1 RC) of the Camel 2.x series.
The project has since grown tremendously and today is one of the most popular integration frameworks out there.

In January 2009 the project became a top level project at Apache.

Apache Camel has been presented at many conferences over the years, the first talk was at the Irish Java Tech Conference in November 2007 by James Strachan. Ever since a lot of people have spoken about Camel at conferences, JUGs, webinars and so forth. We have a link collection where you can find some of these presentations.

The popularity of the Camel project keep rising and at the beginning of 2011, the Camel in Action book went into print.  Having a book published by the well respected Manning publication is a testimony of the popularity of the project.
Here today 5 years later the Camel project goes from strength to strengt, as the next couple of chars proves.
Quarterly visitis on the Apache Camel website

Yearly posts on Camel user mailing list
Number of commits on the project
Number of Camel components out of the box
And since the end of 2011 we have added two more committers, and the upcoming Camel 2.10 release adds a whopping of 18 new components. So the chars is continuing the growth.

Last year the first annual conference in its name - CamelOne - took place in Washington DC, and the event took place in Boston this year. 
2nd annual CamelOne conference
All the sessions from 2012 was recorded, and you can find the videos to watch on your leisure. At CamelOne 2012 we had a sneak birthday celebration of Apache Camel, by having a Camel cake.
Camel Birthday Cake at CamelOne 2012
Today the Camel team is busy finalizing on the last bits for the upcoming Apache Camel 2.10 release.

I guess even James Strachan would not have anticipated what he and the fellow creates of Camel set out 5 years ago, would turn into such a successful project, that he gets a ride on a real Camel.

James Strachan riding a real Camel

2012-06-30

Camel in Action book outdated?

As you may know Jonathan and I got published about 1.5 years ago with the Camel in Action book.

And the book has been very well received within the community, and helped a lot of people getting onboard riding the Camel.

Jonathan and I have done our best to keep the material in the book as up to date to the lastest Camel release. In fact during the type setting period (that takes 4 months) we ensure that material was updated accordingly to new Apache Camel releases. So when the book went into production it was up to date with the Apache Camel 2.5.0 release from October 31st 2010.

Ever since the book was published we have been active on the Author Online forum to catch the minor mistakes and feedback you may have. The errata of the book is fully up to date. In fact the errata was updated as late of a couple of months ago.

Likewise the accompanying source code of the book has been kept up to date with the newer Camel releases, up till the lates official release 2.9.2 And this time we have prepared the source code for the upcoming Camel 2.10 release (currently expected to be GA next week).

Myself, as a reader of other books, this kind of service is rare. Most authors do not bother to even keep an errata, or make sure their source code actually works.

In fact we use the source code for the book as a test suite for the upcoming Apache Camel releases. In fact it was due to this source code we caught a regression in the 2.10 release, that we had to fix that and recut a new release candidate.

So with that in mind, its sad to see a reader post a bad review on Amazon (Click on image to read).
Our first 1-star review
For example the reader complains that he/she cannot find the Apache Camel 2.5.0 download. Well its due to Apache policy that older releases are not highlighted on the website, but available in the Apache Archives. If you click on the download link on the Camel website, we have a heading in the top saying "Older Releases". So its not hard to find.

You can download older Apache Camel releases

2012-06-28

Riding the Camel with a new hat

This morning I woke up to the news out in the public that Red Hat to Acquire FuseSource.  You can read the Acquisition FAQ to learn more what has happened.

This is really great news for the FuseSource team, to find a new home that has truly Open Source in its DNA. Our new home is the JBoss Middleware Team, which are no strangers to what we do. JBoss loves our work we do in the Apache communities and they have been using the Apache products for many years. For example Apache Camel is part of the JBoss products. 

For me personally this means I can continue to do what I love; with my devoted effort in the Camel communities and on the Apache Camel project itself.

My colleague Charles Moulliard, got creative this morning, and gave the Camel a new hat.
The Camel got a new hat. Photo by Charles Moulliard.

I guess its time for me to get a new hat as well. 
Photo of Claus, not wearing a Red Hat (yet)
And I gathered a list of some blogs posted about this news from fellow employees

2012-06-20

Locking down JMX naming now easier with Camel 2.10

The Apache Camel 2.10 is on the way. In fact this morning a RC has been cut. So expect 2.10 to be released soon.


This is a blog post I have had on my todo pad for a while meant to be written sooner. Anyway I got a bit of breather this morning, and wanted to get this done before the 2.10 is released.

Background

So the issue people may have is when they run many Camel applications in the same JVM, such as in Apache ServiceMix, Apache Karaf, Fuse ESB, Fuse ESB Enterprise, Fuse Fabric, and the classic web and JEE servers such as Apache Tomcat, Jetty, JBoss, et all. Its the JMX naming.


So in the JMV we have a default JMX server in which we enlist Camel MBeans, allowing you to manage and monitor Camel apps using JMX. As there is one JMX server, and multiple Camel applications, then we need to ensure the MBeans have unique ObjectName's so they dont clash. 


Apache Camel has out of the box a liberal strategy to cater for this, and in case of a clash, it will by default, auto remedy this by computing a unique name, using a counter based approach. 


For example this may give you ObjectNames with names that contains the counter in the name such as:
...camel-1/...
...camel-2/...
...camel-3/...


The default naming strategy is to use the CamelContext id (eg name) and apply the counter in case of clash. So if you use unique CamelContext id in your Camel applications, then you already have unique ObjectName's in the JMX, and thus no clashes.


The default strategy in OSGi containers is a bit different, as the naming is prepended with the bundle id, which gives us out of the box names such as

...76-camel-1/...
...77-camel-1/...
...78-camel-1/...


And in case you have multiple Camel applications in the *same* bundle, then the naming will use the counter, like for non OSGi environments

...76-camel-1/...
...76-camel-2/...
...76-camel-3/...
...77-camel-1/...
...78-camel-1/...



Okay you have read so far, this is good. So lets get to the point where things have improved in Camel 2.10, and what you can do in previous Camel releases.


The issues is that in OSGi containers, the bundle-id would by default always be prepended, so controlling the naming was a bit harder. What you can do to remedy this in previous Camel releases is to use a custom org.apache.camel.spi.ManagementNamingStrategy, allowing you full control of the namings of the ObjectName's. The problem is that you would then need to implement this interface and code an implementation. So what we have done in Camel 2.10 is to let you configure the naming using a pattern style, much more easily.


To see this in action, lets walk through an use-case.

Walking through an example

This example is created by using the Camel Maven archetype to create a new OSGi Blueprint project, using the camel-archetype-blueprint. This is a simple example that can easily be deployed in an OSGi container such as Apache Karaf. When the project is created, I can compile and build the artifact using mvn install.


I have a vanilla Apache Karaf 2.2.7 extracted, and start it using bin/karaf.

davsclaus:/opt/apache-karaf-2.2.7$ bin/karaf
        __ __                  ____      
       / //_/____ __________ _/ __/      
      / ,<  / __ `/ ___/ __ `/ /_        
     / /| |/ /_/ / /  / /_/ / __/        
    /_/ |_|\__,_/_/   \__,_/_/         


  Apache Karaf (2.2.7)


Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or 'osgi:shutdown' to shutdown Karaf.


Installing Apache Camel in Karaf is now easier using the new chooseurl command as shown below:


karaf@root> features:chooseurl camel 2.10.0
adding feature url mvn:org.apache.camel.karaf/apache-camel/2.10.0/xml/features
karaf@root> features:install camel
karaf@root> 


After installing Camel I can install my application using:


karaf@root> osgi:install mvn:com.mycompany/blue/1.0
Bundle ID: 75


And then I can start the bundle by its id


karaf@root> osgi:start 75


And list the installed bundles


karaf@root> list
START LEVEL 100 , List Threshold: 50
   ID   State         Blueprint      Spring    Level  Name
[  64] [Active     ] [            ] [       ] [   50] camel-core (2.10.0)
[  65] [Active     ] [Created     ] [       ] [   50] camel-karaf-commands (2.10.0)
[  72] [Active     ] [            ] [       ] [   50] geronimo-jta_1.1_spec (1.1.1)
[  73] [Active     ] [            ] [       ] [   50] camel-spring (2.10.0)
[  74] [Active     ] [Created     ] [       ] [   50] camel-blueprint (2.10.0)
[  75] [Active     ] [Created     ] [       ] [   80] A Camel Blueprint Route (1.0.0)

Then I start JConsole to see the JMX tree
JMX name is 75-blueprintContext
My Camel application has been given bundle id 75, which mean out of the box the JMX ObjectName is pre-pended with 75.


Now the issue for some users, is that they may uninstall their applications, and then at a later time install the application again. So lets uninstall our application


karaf@root> osgi:uninstall 75

And then at a later time we install it again. Now the OSGi container will assign the bundle a new bundle id (as it will never re-use a previous bundle id). 


Notice: You can update/refresh your existing application, and keep the bundle id. Its only when you uninstall the bundle, that the bundle id, is discarded, and not used again.



karaf@root> osgi:install mvn:com.mycompany/blue/1.0
Bundle ID: 76
karaf@root> osgi:start 76


And if we see in JConsole we can see the Camel application now has a different JMX ObjectName.


JMX name is now 76-blueprintContext
So how can we control this JMX naming? Well in Camel 2.10 this is now much easier, ad we can define a naming pattern in our CamelContext directly.


There is a new managementNamePattern attribute in the as shown in the screenshot below. This pattern supports a number of tokens which we will cover in a second.
Camel 2.10 using the new managementNamePattern attribute
In this example we just want to use the CamelContext id as the JMX name, so we can use a token in the pattern, as shown using the #name# value. The following tokens is supported


  • #camelId# = the CamelContext id (eg the name)
  • #name# = same as #camelId#
  • #counter# = an incrementing counter
  • #bundleId# = the OSGi bundle id (only for OSGi environments)
  • #symbolicName# = the OSGi symbolic name (only for OSGi environments)
  • #version# = the OSGi bundle version (only for OSGi environments)


Besides the tokens you can use literals, so for example you can do managementNamePattern="foo-#symbolicName#" to have foo- as pre-prended value.

I then rebuild the project using mvn install, and from Karaf I update my application using:
karaf@root> osgi:update 76


And when I look in JConsole now, I can see the JMX naming is no longer having the bundleId prefixed.
JMX name is no longer having bundleId prefixed
The JMX naming is now locked down. This allows me for example to have any JMX capable monitoring tooling be configured once with the JMX ObjectName, and then be able to monitor my application in OSGi containers, regardless which bundle Id my application have been assigned.
Locked down JMX ObjectName
You can find some more details about JMX and Camel at the Apache documentation.


Runtime insight to Camel applications

My application is now running in Apache Karaf, and I can use the Camel Karaf commands to give me some details about my application, such as the context-info command telling me a bit about the uptime, and number of messages (is called exchanges) processed by Camel:

karaf@root> camel:context-info blueprintContext 
Camel Context blueprintContext
Name: blueprintContext
Version: 2.10.0
Status: Started
Uptime: 3 minutes
Exchanges Total: 39
Exchanges Completed: 39
Exchanges Failed: 0
Min Processing Time: 1ms
Max Processing Time: 366ms
Mean Processing Time: 11ms
Total Processing Time: 442ms
Last Processing Time: 3ms
Load Avg: 0.00, 0.00, 0.00
First Exchange Date: 2012-06-20 09:53:11
Last Exchange Completed Date: 2012-06-20 09:56:21



This is all text based, and using a tool such as Fuse IDE I can see all this in real time and visualized using EIP icons as shown below
Fuse IDE with real time visual insight of my running Camel applications in any JVM
Fuse IDE also allows me to see the installed bundles running in Apache Karaf. The bundles can be managed, for example I have stopped my blue application, indicated by the orange ball, which mean the bundle is not started, but in resolved state.
Fuse IDE can manage bundles running in the OSGi container


And know that I talk about Fuse IDE, then it has a nice terminal built-in. This is something that Windows users may struggle with normally, as they would need to use cygwin or something alike to SSH into remote machines. The terminal in Fuse IDE can connect to any remote box, or local running instances such as Apache Karaf.


Fuse IDE with SSH terminal to access Apache Karaf
Okay that's it for all the screenshot galore. Its time to go back to work. Have a nice day. And remember Apache Camel 2.10 is soon to be released, and its a killer release.

2012-06-16

CamelOne 2012 Videos Freely Available

The CamelOne conference took place last month, which I have previously blogged about.

As promised by FuseSource, who was hosting the conference, all the presentations was video taped. And now those videos have been processed and made freely available on the CamelOne website.

Jonathan and I had the pleasure of doing a light keynote of how we got involved with the Apache Camel project, and talking about how the project have evolved over the years, and has been become so successful.

Claus and Jonathan, giving the keynote at CamelOne 2012

Since returning home, I have enjoyed watching the videos of the presentations I didn't have the pleasure to attend.

For example the FAA presentation about the SWIM program is mind blowing. One of their integration challenge is as follows

FAA SWIM integration challenge #3
And the solution is using Apache Camel, and drills down to basically 4 lines of logic

Solution to integration challenge #3
And no wonder FAA loves Apache Camel, they say ...

Yeah Camel Rocks!!!
In the FAA presentation you will see a live demo of their real time weather tracking program called SWIM. It has a fantastic Google Earth interface, so you can see a map of USA, and then drill down to the various airports and see how the weather impacts the flights.

There is a lot of great content in all the videos. And I encourage you to take a look. For example Robin Howlett, shows us how to use Camel and AWS together, and does live coding etc.

And if you are curious what Fuse Fabric is, then I suggest to look at the presentation from Ioannis, who is the lead architect on the project. And Hiram unlocks the mystery of the Apache Apollo, and why its such a great leap forward for the next generations of message brokers. And if you think HTML5 apps is the future, then I suggest o watch the presentation from Charles where he talks about Camel, ActiveMQ, websocket and HTML5 apps.

If you are getting started with Apache Camel, then you may wanna watch my presentation. Its a very practical presentation with a lot of live coding, and showing how you can get started with Camel from scratch.
Claus presenting and doing live coding
And there is a lot more. See for yourself at the CamelOne website.

2012-06-11

FuseSource/Camel intro seminar in Copenhagen this week

Redpill Linpro, a FuseSource partner, is hosting a seminar on integration with Apache Camel, and the FuseSource products.

The event takes place in Copenhagen, on thursday june 14th at 8:30 to 11:30.
The location is very easy to find, as its just next to the Nørreport Metro station.

Frederiksborggade 15, 5th floot
You can find more details about the event here, registration is free.

Hope to see you there.

2012-05-21

Flashback of CamelOne 2012 Conference


CamelOne was yet again a really cool and fun conference. I just returned back home, from the 2nd annual CamelOne conference, held in downtown Boston. It was a 2 day packed with great talks with a balanced mix of technical talks, cloud stuff, and showcases of integration in the real world.


CamelOne speaker podium
The feedback of the conference was really good, as you can see from the image below.

Feedback wall from CamelOne attendees

The FuseSource engineering team was present, and on the end of the 2nd day, Debbie, got us together for a photo session.

The FuseSource Engineering Team
CamelOne 2012 - Day 1
So back the the 1st day. This year Jonathan and I was asked to do the opening key note, with our Camel story, and where the Camel project is today, and some thoughts about how Camel can riding the cloud in the near future. Jonathan and I wanted to tell our Camel story, and also with a sense of humor. I can say mission accomplished when the slide with the lovely Camel picture was shown. And no the picture is not retouched, it was found using google image search.


Apache Camel is a project that stands out

After the keynote I gave a talk about how to get started riding the Camel. The talk is a practical focus talk so I was sharing the time 50/50 between slides and live coding. As all sessions is video recorded, we can all watch them later, as they will be posted on the CamelOne website, free for anymore to watch. A professional production company is currently processing the videos. They should be ready in weeks from now. I will blog when the videos is online.

Jonathan was next after my talk, and his talk was a natural progress from mine talk. As he gave a rundown how you can run and deploy Camel and CXF applications in the ESB server. Jonathan showed how this works in practice as well.

I got engaged in a number of hallway conversations, and didn't have the chance to attend a session at every slot.  It was really great to meet so many happy Camel users, and hear their stories, where the Camel is riding in the real world. Also I was told that more and more commercial vendors is adapting Camel and embedding it internally in their commercial products. 

Kai Wahner gave his first of two talks today.
Kai Wahner giving a talk about choosing Integration Frameworks
He was talking about his experience with evaluating Apache Camel, Spring Integration, and Mule ESB. I guess Camel was in favor at a Camel conference :)

James gave the ending general session of the first day.
James Strachan giving ending key note on 1st day
As always a pleasure to watch James talk with such a enthusiasm. His talk was a technical talk addressed to the developers how to develop and get Camel riding in the cloud. He gave a tour of the cool and awesome much improved Fuse IDE 2.1 product. It now has even more Camel crack for runtime insight. As well as easier deployment for both local jvms, remove machines, and as well the clouds.


CamelOne 2012 - Day 2
On the 2nd day, we have Gabe Zichermann giving a very entertaining keynote, about gamification.
Gabe talking about Gamification
The idea of getting people engaged, based on the ideas of computer games. But applying them in a real life processes. For example a company managed to get its employees go to the gym, based on teaming up, and competing against your co-workers.

In Sweden they have traffic cameras, using reverse sychology, by enlisting people in a lottery, if they are within speed limits. However people above the speed limit will of course still get a fine, and not participate in the lottery.

I have heard good buzz about Stan Lewis and Dhirajs talk about how to manage, monitor and provision a cluster of machines, in a data centre or the cloud. Dhiraj showed how Fuse HQ could monitor the Camel applications running on numerous machines. And how that worked as well when Stan did a rolling upgrade on the fly, leaving Fuse HQ being able to compare and display a "before" vs. "after" overview.

Likewise the tweets about Charles Moulliard was very positive. Seems like people wanted to go and play with websockets, and the Camel. This is definitly cool. So Camel 2.10 is a much anticipated release, having the websocket component out of the box.

Kai was on the stage again, giving a talk about using Apache Camel with BPM (Avtiviti). Kai gave us a rundown of the differences between Camel and Activiti, and where they overlap. As well when you should use either one, or both of them. In Kais talk he give live demos which is a nice change in the flow, to see the "code" for real. Activiti and Camel together seems powerful. And the Activiti designer looks beautiful.

Did you know that Camel is help protecting the Canadians. Mike Gingell from General Dynamics Canada gave us a rundown of how they have been successful by using open source integration technologies from Apache. The Camel is helping in cool stuff such as with the marine to detect torpedo attacks, with satellite surveillance of the north poles, and to keep track of personel and whatnot.
Torpedo Warning System. Slide from Mike Gingell, General Dynamics Canada,
Mike gave a really great talk, and also took us through how his team is battling uphill in a traditionally conservative organization where software projects take millions of $ and years to just get started. They have been on the open source road for about 5 years, and jumped on Apache ServiceMix when it became OSGi based. And the Camel has been riding all along together with ActiveMQ and CXF. So the Camel is help protecting Jonathan Anstey, who lives in New Foundland, Canada. Must be cool to know that the software he works on every day, is now serving the people of Canada.

The ending keynote, was a real treat to all of us. Felix Ehmn from CERN gave us a very interesting talk how CERN is using ActiveMQ in their control room, to monitor the most complex machine man have ever built - the Large Hadron Collider; eg the 27km circle where they smash atoms together and see what happens.

Felix giving ending keynote, about CERN using ActiveMQ
There is 85.000 devices, which they need the monitor. Its everything, from censors on the collider, to fire alarms, door buttons and whatnot. CERN is definitily a cool place. In fact the coolest place on earth as well, as they need to cool down the collider, to 1 degree kelvin. That is - 272 degrees celsius.

Like CERN, the CamelOne conference was very cool.

I discovered a number of other blogs covering the CamelOne 2012 conference


Hope to see you in 2013 at the next CamelOne conference.

As David Reiser tweeted, the conference was awesome.
David liked the conference