camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: throttling a restlet endpoint by discarding excess requests
Date Wed, 28 Aug 2013 04:18:18 GMT
Well, another thing you could look into is using a custom
ScheduledThreadPoolExecutor for the throttler. You could use a
BlockingQueue with a specific size (10 in your case), and any others that
tried to get scheduled would through an exception. Then in the throttler
config you would set 'callerRunsWhenRejected' == false so that an exception
is thrown.

Take a look here for setting your own custom queue for the
ScheduledThreadPoolExecutor:
http://stackoverflow.com/questions/13514441/scheduledthreadpoolexecutors-and-custom-queue

And take a look here for setting custom executor service for the throttler:
http://camel.apache.org/threading-model.html

HTH


On Tue, Aug 27, 2013 at 8:53 PM, osupit <ollie.supit@gmail.com> 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.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message