Hi,

There are different options to achieve this. You can either set the 
throwExceptionOnFailure option to false. Then you will have access to the 
response payload if the server sends one, but you might have to evaluate the 
HTTP response code by yourself.

Alternatively you can create an onException handler on the 
AhcOperationFailedException and call the getResponseBody method on that in 
order to get the response body.

Best regards
Stephan

-----Original Message-----
From: prabhuj [mailto:[email protected]] 
Sent: Dienstag, 4. Oktober 2016 15:47
To: [email protected]
Subject: camel-ahc response body after exception

I am getting AhcOperationFailedException while invoking http call using
camel-ahc component. How can i capture the response body of http call that
resulted in AhcOperationFailedException ?

My route

from("activemq:queue:MY_QUEUE")
        .process(this.processor1)
        .to("ahc:http://example.com/v1/hello";)
        .process(this.processor2);



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-ahc-response-body-after-exception-tp5788350.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to