camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6300) AdviceWith doesn't work with doTry
Date Mon, 22 Apr 2013 14:47:16 GMT

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

Claus Ibsen commented on CAMEL-6300:
------------------------------------

Need to merge to 2.11 branch when its setup
                
> 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
>
>
> 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

Mime
View raw message