2010-12-07

Camel 2.6 - Improved management of custom processors and beans

I think its time for a non book related blog entry so here goes.

I have been having "fun" with the JMX API lately. I wont get into how utterly SUN managed to mess up from framework developer point of view. I am still puzzled why they didn't ship annotations in the JDK that allows you to decorate your beans for management. Just as the Spring guys already have done.

Anyway you may want to use custom business logic with Camel using a org.apache.camel.Processor or even better as a POJO.

Now in Camel 2.6 onwards the processors and beans which are defined in the Camel routes will now also be enlisted in JMX for management. By default they provide basic information, but you may want to expose some custom attributes and/or operations as well.

Now this is possible simply by decorated your processor/bean using the Spring JMX annotations. Camel detects the @ManagedResource annotation on takes it from there.

The only issue is that your custom processor/bean wont have the basic information that Camel usually provides, such as performance statistics. The reason is the aforementioned JMX API being a pain in the ****.

If you want to look for an example then I have updated this old FAQ entry about this new change.

No comments: