camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Forced "termination" of the current exchange and returning appropriate response code
Date Fri, 20 Jul 2012 12:59:33 GMT

You can do a content based router, and if the certificate is invalid,
then return a response.

There is also a stop EIP to stop further processing. You can put that
on the exchange as a property from java code, eg so you can just use a
bean to check if the certificate is valid or not. And if not valid,
then set the message with some response payload, and then mark it to

There is a constant on Exchange with the name of the property

See for example the StopProcessor source code.

There are other ways such as thrown an exception and using the error
handler to react and stop routing etc.

On Thu, Jul 19, 2012 at 9:37 AM, helander <> wrote:
> In my setup I have a cxf endpoint that are consumed by a route. As the first
> step in my route I have a bean that picks up the TLSSession from the
> exchange and puts back a property on the exchange that contains the peer
> certificates. I doing this in order to access information from the client
> certificates further down the route. In the case that no client certificate
> has been provided (access was via http and not https or the http server
> configuration may not have required the certificates to be provided by the
> client) I would like to force the exchange to "return" ( no further
> processing along the route) and provide some appropriate return code.
> What specific operations do I have to do on the exchange (or its in/out
> messages) to make Camel "terminate" the route with the appropriate (HTTP)
> return code.
> /Lars
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message