Adding JMX attributes and operations
Camel provides a lot of JMX information for internal constructs (routes, endpoints, and so on) as well as for Java classes invoked from Camel. For example, when you include a call to a custom Java method as a part of a route, Camel will expose that through JMX as a Camel Processor and associate many JMX attributes with it. These include how many messages were sent to that processor, number of redelivery attempts, timestamps for initial and last messages processed, and so on.
There are times when you want to provide custom, or additional, JMX attributes and operations, such as code-specific metrics, and you want the ability to monitor and interact with these from your operational monitoring tools. This recipe shows how to annotate your Java code to expose custom JMX attributes and operations. These will seamlessly integrate with, and augment, the management information provided by Camel.
Getting ready
The Java code for this recipe is located in the org.camelcookbook...