camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alban Joly <>
Subject Sending a custom HTTP Response in case of exception
Date Tue, 05 Mar 2013 18:05:46 GMT
Hi all,

I am trying to send to the caller an http response with a fixed message in
the body (an an error status code of course)

My route is :

<from uri="servlet:///XXX?matchOnUriPrefix=true" />
<inOnly uri="activemq:queue:YYYY" />

In case of exception (ActiveMq not connected for example), I received an
response with an error status code but with the stack trace in the body. I
would like to replace this body with a fixed message.

I have tried with OnException and doens't work at all ...

I have tried with doTry doCatch, and the result is different (not really
better): Now, if handled : true I receive an 200 status response with no
Body. If not handled, no change ...

My code

			<camel:log message="AAAAAAAAAAAAAAAAAAAAAAAAAA"></camel:log>

I have tried some different case : with setBody, with setFaultBody, ... and
i have never successed to display a custom message in the http error status 

Anyone can help me please ?

Thank you

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message