Here is a way to do it. I think you can structure your routes (one route per branch) to make it simpler to use JMX to monitor activities each branch.

.when(header(CxfConstants.OPERATION_NAME).isEqualTo("getFoo"))
    .to("direct:getFooBranch")
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("getBar"))
    .to("direct:getBarBranch")
...
from("direct:getFooBranch").to("...")
from("direct:getBarBranch").to("...")

Check out the wiki on Camel-jmx.
http://camel.apache.org/camel-jmx.html

HTH

On 01/12/2013 09:35 AM, Martin Stiborský wrote:
Hello,
In my Camel project, I have exposed several cxf:rsServer on same
address/port but listening on different root paths. Every root path then
continue with more specific paths defined with CXF @Path.

Which resource is requested is possible to find out thanks to
CxfConstant.OPERATION_NAME.
So one chunk of a route looks like this, for example:

.when(header(CxfConstants.OPERATION_NAME).isEqualTo("getFoo"))
                     .to("...")
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("getBar"))
                     .to("...")
...

My need is that I'd like to know, which branch of the condition is
invoked&processed so I can use the information in log file. More
specifically, I'm logging elapsed time in the route (
http://java.dzone.com/articles/measure-elapsed-time-camel).
I know how long the route takes to finish, there is a routeId, but I don't
know which branch was in action for particular log record.

Is there a way how to put some marker to every branch within one route so I
can recognize it in the log file?

Thanks for help.


Reply via email to