Just re-reading the "Binding POJOs" bit, will this also take effect for the
out part of an exception?

onException(MyException.class).handled(true).setHeader(Exchange.HTTP_RESPONSE_CODE,
constant(400)).process(myExceptionHandler).end()

Should I expect the Message provided by myExceptionHandler to be formatted
to JSON/XML according to the HTTP client's choice?


On 21 January 2015 at 11:51, James Green <james.mk.gr...@gmail.com> wrote:

> If Camel can accept and map both JSON and XML inputs to POJOs, is there a
> way of reversing this for onException handling purposes?
>
> The only example of onException sets the content-type and formatted
> content on the Exchange. But I may not know this.
>
> Within Spring MVC there is @ResponseStatus allowing us to specify the HTTP
> response code for a particular Exception without needing to care about the
> response content type, which is the bit I'm not spotting an equivalent for.
>
> Am I missing something or is this a bit of a hole?
>
> Thanks,
>
> James
>
>

Reply via email to