You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Petr Juza (JIRA)" <ji...@apache.org> on 2013/06/09 22:21:20 UTC

[jira] [Commented] (CAMEL-6300) AdviceWith doesn't work with doTry

    [ https://issues.apache.org/jira/browse/CAMEL-6300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679144#comment-13679144 ] 

Petr Juza commented on CAMEL-6300:
----------------------------------

Please, is any workaround for this bug? 
We aren't able to test every route where we use doTry-doCatch ...
                
> AdviceWith doesn't work with doTry
> ----------------------------------
>
>                 Key: CAMEL-6300
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6300
>             Project: Camel
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 2.10.4
>         Environment: Java 6, macos
>            Reporter: Petr Juza
>            Assignee: Claus Ibsen
>             Fix For: 2.10.5, 2.11.1, 2.12.0
>
>
> I have the following route definition:
> {code}
>         from("direct:billing_" + operation)
>                 .routeId(getRouteId(operation))
>                 .errorHandler(noErrorHandler()) // propagate exceptions to the parent route
>                 .validate(body().isInstanceOf(
>                         com.cleverlance.cleverbss.integration.modules.in.customer.model.Customer.class))
>                 .beanRef(BILLING_CUSTOMER_ROUTE_BEAN, "createRequestFor" + WordUtils.capitalize(operation))
>                  // SetCustomer -> XML
>                 .marshal(jaxbIn)
>                 .doTry()
>                     .to(uri + "?messageSender=#billingSender").id("toURI")
>                 .doCatch(AlreadyExistsException.class)
>                     .setProperty(exPropertyName, property(Exchange.EXCEPTION_CAUGHT))
>                 .end()
>                 .choice()
>                     .when(property(exPropertyName).isNull())
>                     // XML -> SetCustomerResponse
>                     .unmarshal(jaxbOut)
>                 .endChoice();
> {code}
> And I would like to replace TO in the tests:
> {code}
>         getCamelContext().getRouteDefinition(BillingCustomerRoutes.ROUTE_ID_UPDATE_CUSTOMER)
>                 .adviceWith(getCamelContext(), new AdviceWithRouteBuilder() {
>                     @Override
>                     public void configure() throws Exception {                        
>                         weaveByType(ToDefinition.class).replace().process(new Processor() {
>                             @Override
>                             public void process(Exchange exchange) throws Exception {
>                                 throw new AlreadyExistsException("msg", new AlreadyExists());
>                             }
>                         });
>                     }
>                 });
> {code}
> When I use weaveById("toURI") or weaveByToString(), it doesn't work neither.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira