You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "knewsom@gmail.com" <ke...@gmail.com> on 2016/07/17 01:45:18 UTC
Filtering or 'short circuit' a route
Hello,
I am looking for some suggestions on how I might 'filter' an http route. The
general idea is to create a process that checks the http request for a valid
oauth access token and if valid, allows the route to continue. If missing or
invalid, 'something' would return an http response of 401 or 403 to the
client without completing the route (short circuit).
I've glanced through some of the EIP but I haven't seen anything that I
could obviously use for this.
Thanks in advance,
Kevin
--
View this message in context: http://camel.465427.n5.nabble.com/Filtering-or-short-circuit-a-route-tp5785185.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Filtering or 'short circuit' a route
Posted by Richard Davidson <ri...@gmail.com>.
You could setup your error response and then use .stop() in the DSL, or
mark the exchange to stop from Java code. e.g.
// mark the exchange to stop continue routing
exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE);
On Sun, Jul 17, 2016 at 10:08 PM, knewsom@gmail.com <ke...@gmail.com>
wrote:
> Thank you for the reply.
>
> The general idea is to not forward the message along to the endpoint server
> if the credential check fails.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Filtering-or-short-circuit-a-route-tp5785185p5785197.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Filtering or 'short circuit' a route
Posted by "knewsom@gmail.com" <ke...@gmail.com>.
Thank you for the reply.
The general idea is to not forward the message along to the endpoint server
if the credential check fails.
--
View this message in context: http://camel.465427.n5.nabble.com/Filtering-or-short-circuit-a-route-tp5785185p5785197.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Filtering or 'short circuit' a route
Posted by Mark Frazier <mm...@me.com>.
install a headerFilterStrategy or just write your own processor that checks the headers.
But… I think that you will get an error anyway from the remote server and camel will pass it along as you need.
> On Jul 16, 2016, at 6:45 PM, knewsom@gmail.com <ke...@gmail.com> wrote:
>
> Hello,
>
> I am looking for some suggestions on how I might 'filter' an http route. The
> general idea is to create a process that checks the http request for a valid
> oauth access token and if valid, allows the route to continue. If missing or
> invalid, 'something' would return an http response of 401 or 403 to the
> client without completing the route (short circuit).
>
> I've glanced through some of the EIP but I haven't seen anything that I
> could obviously use for this.
>
> Thanks in advance,
>
> Kevin
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Filtering-or-short-circuit-a-route-tp5785185.html
> Sent from the Camel - Users mailing list archive at Nabble.com.