could be much more easier/simplier to add a guard to the restlet route,
keep track of this throttling limit and return the exception from inside
Restlet.

see http://restlet.org/learn/tutorial/2.1/#part09

'guard' could be used for more needs than just securing access.




On Wed, Aug 28, 2013 at 10:38 AM, Claus Ibsen <[email protected]> wrote:

> Hi
>
> Yeah I assume you can configure the restlet server to have X worker
> threads. So if the load gets higher it will not accept new incoming
> requests. Or maybe a way of returning HTTP 503 as you want.
>
> Though the Camel throttler EIP could have an use-case for having a way
> of having a when .. otherwise built in so you can do
>
> from restlet
> throttle (10 / sec )
>     to backend
>     to some more stuff
>  otherwise
>     setHeader status = 503
>     setBody = empty
> end
>
>
>
>
>
> On Wed, Aug 28, 2013 at 5:53 AM, osupit <[email protected]> wrote:
> > Very much appreciate the quick response and insights.
> >
> > Unfortunately the requirement is as originally stated - I need to discard
> > excess load by returning excess requests to the caller - so the Throttler
> > option doesn't work for me.
> >
> > I'll have a poke around the Restlet docs/community and see if this has
> been
> > come up before.
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/throttling-a-restlet-endpoint-by-discarding-excess-requests-tp5738089p5738099.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [email protected]
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Reply via email to