camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gareth Bird (JIRA)" <>
Subject [jira] [Reopened] (CAMEL-7476) cxfrs throwExceptionOnFailure option not working
Date Mon, 23 Jun 2014 11:00:26 GMT


Gareth Bird reopened CAMEL-7476:

Thank you for taking the time Willem for writing the test case to prove that throwExceptionOnFailure=false
suppresses exceptions.

I still do have exceptions being raised in the route. 

I've been looking at my code, your code, and the cxfrs source - what I am now thinking is
that the exception may be being raised on this line in (

       // invoke the client
        Object response = null;
        if (responseClass == null || Response.class.equals(responseClass)) {
            response = client.invoke(httpMethod, body);
        } else { ...

The exception type is, so it may be being raised by CXF during
invoke.  The REST service being called is returning a status of 412 (already exists).  

For reference - this is how I am calling the service in the route:

[ As an aside I am invoking OpenDJ - LDAP REST service - to create a user ]

If response status 4xx, CXF will wrap response in and throws

So to re-cap I think that CXF is raising the exception - should these type of exception  be
caught by and suppressed in the method invokeHttpClient?


> cxfrs throwExceptionOnFailure option not working
> ------------------------------------------------
>                 Key: CAMEL-7476
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.13.0, 2.13.1
>            Reporter: Gareth Bird
>            Assignee: Willem Jiang
>            Priority: Minor
> (1) The cxfrs option throwExceptionOnFailure=true does not suppress exceptions from being
thrown when an invoked REST service returns a http status > 207.  i.e. the following does
not work:
> ...
> .to("cxfrs:bean:rsClient?throwExceptionOnFailure=false")
> ....
> (2) The cxfrs throwExceptionOnFailure option should default to false; to make it easier
to process status codes in the route.
> When invoking REST services, the logic is currently complicated by the fact that common
status' need to be processed in exception handlers. i,e (404 not found, 412 precondition failed).
 It would be more useful to filter on statuses with a main route.

This message was sent by Atlassian JIRA

View raw message