camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serge Smertin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-7786) Global exception handling breaks routeId
Date Fri, 05 Sep 2014 18:30:28 GMT
Serge Smertin created CAMEL-7786:
------------------------------------

             Summary: Global exception handling breaks routeId
                 Key: CAMEL-7786
                 URL: https://issues.apache.org/jira/browse/CAMEL-7786
             Project: Camel
          Issue Type: Bug
    Affects Versions: 2.12.0
            Reporter: Serge Smertin


This is somehow related to CAMEL-2109. Using Java DSL and code like

{code}
onException(Error.class).to("errorChannel");
from(somethingChannel).routeId("triggerDoingSomething")
                .inOnly("bean:foo")
                .inOnly("bean:blah");

/// later doing

context.getRouteDefinition("triggerDoingSomething").adviceWith(context, new AdviceWithRouteBuilder()
{
                @Override
                public void configure() throws Exception {
                    weaveAddFirst().process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            dumpSomeValues();
                        }
                    });
                }
            });
{code}

does not work, as {code}OnException[[class java.lang.Error] -> [To[errorChannel]]]{code}
has no parent and `AdviseWithTask` never gets `match = true` in a loop. I guess it would not
even work with multiple OnException definitions.

workaround? `weaveByType(OnExceptionDefinition.class)`? Ideas? Is it the right use of route
identifiers?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message