Apache Camel 2016 Numbers

Its been 5 years since I last did a blog post about the Camel numbers.

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

Number of releases in 2016: 12
Number of posts on Camel user forum in 2016: 5423
Number of commits in 2016: 4325 (git shortlog -ns --since 2016-01-01 | cut -c1-7 | awk '{ SUM += $1} END { print SUM }')

Total number of tickets created at end of 2016: 10663
Number of tickets created in 2016: 1192
Number of tickets resolved in 2016: 1256

Total number of commits at end of 2016: 26390
Number of stars on github at end of 2016: 1149
Total number of contributors on github at end of 2016: 267
Number of closed pull requests at end of 2016: 1363
Number of closed pull requests in 2016: 615
Number of committers doing commits in 2016: 192 (git shortlog --after 2015-12-31 --before 2017-01-01 -ns | wc -l).

You can find more statistics at github and Open Hub.

Happy New Year and 2017 is going to be a special year for Apache Camel.


Work started on Apache Camel Intellij IDEA plugin

Just because its Christmas does not mean the Camel stands still.

On the even of the 23rd I took the evening to do a bit of research and start hack on a little prototype for an Apache Camel plugin for IDEA. Its something that has been on my radar for a longer time. 

The reason is that Apache Camel provides a catalog with has a ton of great information for tooling. The catalog includes every little detail about every Camel component, EIPs, data formats, languages, and much more.

I have long wanted to have a little plugin for IDEA (and also Eclipse if possible) for code assistance to setup Camel endpoints - in other words, having ctrl + space to show a list of Camel options you can use on any given Camel endpoint.

Sidestory begins ...
So in the darkness of the night I found myself back in Intellij IDEA plugin land. It was a long long time since last time I hacked on a IDEA plugin. It was so many years ago I cannot remember exactly, but it was around 2002. I created a little plugin called Generate toString which would generate nice toString methods for your POJO classes, like you can generte equals/hashCode etc. Over the years that followed I maintained the plugin and upgraded it for newer IDEA versions which would often break the plugin, or they have moved/changed their APIs. Back then the plugin API was hardly documented, and there was no source code of the editor itself, so it was no fun to try to figure out how to get it to work again, or how to use some of  the existing IDEA dialogs etc. But in the end it was possible, and for a few dialogs I actually had to build it myself using Java Swing etc. The plugin later found a new home at Jetbrains where they took over and provides the plugin out of the box in IDEA. Thanks Jetbrains. You make the best editor on the planet. 
You can read more about this story in the following blog posts: Fast forward to 2016 and I was back in somewhat familiar waters, the AST model is still named PsiSomething.
... sidestory ends.

However doing a plugin that hooks into the Java language of IDEA took a while to find out, because I was walking down the wrong path, trying to find an extension-point about smart completion. 

So instead I looked at some of the out of the box plugins as you can find their source code, and eventually found a plugin that hook into the Java language which took me down the right path.

So after a while I got something working, which was marvelous to see that the smart completion suggestion list included the Camel endpoint options for the given component.

On christmas morning I hacked some more, and posted a tweet with the first screenshot

Today on the 25th December I do have a bit more time as well to polish up the code and to publish it on github. 

I have created a new project on github where we can hack on the code to make the plugin awesome and great. The intention is that the code eventually will be donated to Apache Camel. But for now we can keep it separated so its easier because there is only the plugin code, and not all the other Camel source as well.

You can find more details on the github page, where there is instructions how to try / run and build the plugin. There is also a issue tracker with tickets for stuff we need to work on.

Anyone is welcome to help with the plugin.

Sadly I don't have so much time currently to justify spending days hacking on the plugin, even thought it would be really fun. I have to focus on completing the Camel in Action 2nd edition book. I am 85% complete with the microservices chapter, and then have another chapter to complete as soon as possible in the start of 2017. However I am also a human whom want to have a bit fun hacking so I will hack a bit from time to time on the plugin.

A shameless plug for the book, there is a 40% discount code during the holidays.

The discount code is camiach(40% off Camel in Action, Second Edition, all formats, expiration: January 7, 2017)

To finish this blog post here are the latest screenshot of the Camel IDEA plugin in action:
Smart completion to present possible Camel options

The plugin also supports smart completion for the values, for example an enum based option shows which choices there are (and which one is the default if there is a default value)

Smart completion for enum values


Status of Camel in Action 2nd edition book

Jonathan and I just wanted to give an update on the status of the book, now that we are entering 2017 which will be the year the book is finished. Before summer 2017 we all have the final book in our hands.

Manning have told us the book is doing well, and they have granted us with a special x-mas holiday promotion code.

The discount code is camiach (40% off Camel in Action, Second Edition, all formats, expiration: January 7, 2017)

Yesterday we send out the following letter to our readers of the Camel in Action 2nd edition book.

Dear Reader,

2016 is coming to an end and we are well aware that we need to hurry up and complete the remaining chapters.

Claus has been busy of late with personal "stuff" which has taken away time and energy that he would otherwise have put toward the book. However the "stuff" is clearing up and he has free time to get back in the saddle and into the writing zone. He is on track with the popular microservices chapter that will be ready in the beginning of 2017.

Jonathan is closing in on having chapter 15 ready as well for the beginning of 2017 where a new MEAP update can be expected.

Then there are two more chapters scheduled. Claus will work on a container chapter that covers all the exciting new technologies with containers, Docker, Kubernetes, cloud, and so on.

We are very pleased that Henryk Konsek has agreed to be our guest author on a chapter about Camel and IoT.

We are revising the TOC and have decided to fold chapter 17 and 18 together into a single chapter about Camel, containers, and cloud where clustering is natural. This also means there is one less chapter and the book will be finished sooner.

After all the chapters are complete, we will revise every single chapter with all the feedback from the reviews and from our technical editors. So expect the material to sharpen up, and be much more fluent and pleasant to read when the proof editors have done their magic.

Kind regards,

Jonathan and Claus


Camel Live Reload of XML routes

Its been a while since I last did a Camel video. So today I recorded a video of the upcoming live reload functionality in Camel 2.19.

You can now enable live reload of your Camel XML routes which will trigger a reload on-the-fly whenever you save the XML file from your editor.

This is demonstrated in the short 5 minute video.

You can use the Camel live reload easily when using:

  • Camel standalone with Camel Main class
  • Camel Spring Boot
  • From the camel:run maven plugin

And for other use-cases you can enable this manually be setting a ReloadStrategy on the CamelContext. We provide the FileWatcherReloadStrategy out of the box, which is what is used above as well. However the idea is that end users can provide their own custom strategies as well.

We ship two examples out of the box which you can look at and try for yourself


Camel Maven Plugin can now parse your source code and report invalid endpoints

I have previously blogged about the fabric8 Camel Maven Plugin which is able to parse your source code and parse all the Java RouteBuilder and XML routes and report invalid Camel endpoints.

That was in the start of 2016. Now at the end of 2016, the code has stabilized and the fabric8 team has gracefully donated the source to to ASF so it will be included out of the box from Apache Camel 2.19.0 onwards.

To see the plugin in action you can watch the video from my previous blog. The plugin would work the same when its from Apache Camel.

To give a demonstration of the plugin, I have modified the camel-example-twitter-websocket example from Apache Camel to make some invalid configurations:

- Renamed the polling to poling in the twitter endpoint
- Added foo=bar as option to the log endpoint
- Spelt the sendToAll option with a lower case a.

And when I run the plugin I see

mvn camel:validate

Then Maven outputs:

[INFO] --- camel-maven-plugin:2.19.0-SNAPSHOT:validate (default-cli) @ camel-example-twitter-websocket ---
[INFO] Using Camel version: 2.19.0-SNAPSHOT
[WARNING] Endpoint validation error at: org.apache.camel.example.websocket.TwitterWebSocketRoute.configure(TwitterWebSocketRoute.java:109)


                   type    Invalid enum value: poling. Possible values: [polling, direct, event]. Did you mean: [polling]. Default value: direct

[WARNING] Endpoint validation error at: org.apache.camel.example.websocket.TwitterWebSocketRoute.configure(TwitterWebSocketRoute.java:110)


                    foo    Unknown option

[WARNING] Endpoint validation error at: org.apache.camel.example.websocket.TwitterWebSocketRoute.configure(TwitterWebSocketRoute.java:112)


              sendToall    Unknown option. Did you mean: [sendToAll]

[WARNING] Endpoint validation error: (0 = passed, 3 = invalid, 0 = incapable, 0 = unknown components)
[INFO] Simple validation success: (0 = passed, 0 = invalid)
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

As you can see it discovered 3 invalid endpoints, and reported suggestions what is the error.

By default the maven goal does not fail maven itself, and hence why you see BUILD SUCCESS. The plugin has a number of options you can configure.

For more information see the Camel Maven Plugin documentation.

PS: The plugin also parses your Simple expressions and report invalid configurations as well.

We may in the future add parsers for other languages so we can parse XPath, XQuery, Groovy and others.