On Thu, Apr 26, 2012 at 8:16 PM, Eugeniu <[email protected]> wrote: > I think your advice won't work in my case since I am trying to send different > replies based on some conditions. > Here is the scenario I am trying to implement in a route: > 1. <from> is a cxf endpoint which gets order requests. > 2. Perform first validation stage. If error - construct a error message, > send to the client and stop. If not go to third step. > 3. Perform second validation stage. If error - construct a different error > message, send it to the client and stop. If validation passed go to step 4. > 4. Send a message to an activemq queue and send the webservice client an > acknowledgement of successful order receipt. > > Can I somehow specify that the error messages I am building at step 2 or 3 > should be sent as a reply to the initial web service request? >
Yes it depends if you validate and throw an exception, you can use onException and handle the exception to construct a custom reply message to the cxf client. Some links http://java.dzone.com/articles/camel-exception-handling?mz=62823-enterprise-integration http://camel.apache.org/exception-clause.html http://camel.apache.org/error-handling-in-camel.html And there is examples in the Camel in Action book on page 146. > -- > View this message in context: > http://camel.465427.n5.nabble.com/Understanding-Request-Reply-EIP-in-Spring-DSL-tp5662809p5668306.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
