Re: Setting rest response json directly

2014-11-04 Thread Claus Ibsen
Hi And using .setBody(simple("{ \"error\": \"${exception.message}\" }")) Does not work? On Wed, Nov 5, 2014 at 7:02 AM, Gary Kennedy wrote: > Greetings all, > > I'm using the camel rest dsl in a karaf osgi blueprint to define my route > (and I love it, so easy), and I've got an onExc

Re: Setting rest response json directly

2014-11-05 Thread Gary Kennedy
I'm using blueprint, but yes, it does not work. { "exception": "${exception.message}" } Produces response content of: "{ \"error\": \"${exception.message}\" }" Instead of: { "error": "${exception.message}" } I'm using the servlet/rest config, ie:

Re: Setting rest response json directly

2014-11-09 Thread Gary Kennedy
I changed the way I used the servlet/rest component and it works for me now. I'm still using the same bean setup as before: But now I've dropped the rest part, and using servlet endpoints to start the routes:

Re: Setting rest response json directly

2014-12-02 Thread Claus Ibsen
Hi >From Camel 2.14.1 onwards we have made this easier with https://issues.apache.org/jira/browse/CAMEL-8104 So if you have a custom error message you just set the HTTP error code to a value 300+ and rest-dsl will not do output binding. There is a new option that is turned on by default, you can