Hi

Could you create a JIRA ticket for this?


On Thu, Jul 23, 2009 at 8:00 PM, msjwhite<[email protected]> wrote:
>
> I've found that some of our routes are not getting instrumented using JMX and
> we get the following WARN for those on startup;
>
> InstrumentationLifecycleStrategy: Route has not been instrumented for
> endpoint: ...
>
> It turns out that its only those routes that have an onException handler as
> the first processor in the route, e.g.
>
> <route id="per-msg-route" errorHandlerRef="RouteErrorHandler">
>  <from uri="jms:MSG_IN"/>
>  <onException>
>    <exception>can.retry.Exception</exception>
>    <redeliveryPolicy ref="UnlimitedRedeliveryPolicyConfig"/>
>    <handled><constant>true</constant></handled>
>  </onException>
>  <bean ref="Formatter" method="formatInput"/>
> ...8<...
>
> On checking the code, it appears that the instrumentation processor for the
> route gets registered to the first output processor regardless of what it
> is.  I think the assumption that all messages will go through the first
> processor in the route is incorrect as in our case it attaches to the
> onException processor which will not ordinarily fire;
>
> InstrumentationLifecycleStrategy:
> ...8<...
>    // instrument the route endpoint
>    final Endpoint endpoint = routeContext.getEndpoint();
>
>    // only needed to register on the first output as all rotues will pass
> through this one
>    ProcessorDefinition out = routeContext.getRoute().getOutputs().get(0);
>
>    // add an intercept strategy that counts when the route sends to any of
> its outputs
>    out.addInterceptStrategy(new InterceptStrategy() {
> ...8<...
>
> I've worked around the problem by changing the code to attach the
> instrumentation processor to the first non onException processor in the
> route;
>
> InstrumentationLifecycleStrategy:
> ...8<...
>    // instrument the route endpoint
>    final Endpoint endpoint = routeContext.getEndpoint();
>
>    ProcessorDefinition out = null;
>
>    // Look for first non onException output
>    for (ProcessorDefinition processor : route.getOutputs()) {
>        if (processor instanceof OnExceptionDefinition) continue;
>            out = processor;
>    }
>
>    if (out != null) {
>        // add an intercept strategy that counts when the route sends to any
> of its outputs
>        out.addInterceptStrategy(new InterceptStrategy() {
>            public Processor wrapProcessorInInterceptors(ProcessorDefinition
> processorDefinition, Processor target, Processor nextTarget) throws
> Exception {
>                if (registeredRoutes.containsKey(endpoint)) {
> ...8<...
>
> I'm not sure if this the correct fix for this or not, but the attributes for
> the routes now do get updated when messages flow.
>
> I've not seen any changes in M3 to suggest that this is fixed.  I hope you
> can make a fix for this for 2.0 release, because the route JMX
> instrumentation is very useful and is saving us a lot of work in adding our
> own intercepts to do similar things.
>
> Thanks
> Mark
>
> --
> View this message in context: 
> http://www.nabble.com/Routes-JMX-attributes-not-updated-in-2.0-M2-tp24631265p24631265.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to