You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rallavagu <ra...@gmail.com> on 2014/06/06 19:20:32 UTC

Throttler

All,

I am evaluating Camel to be a proxy/gateway to REST internal end points. 
I have set it up as a servlet on Tomcat and configured for http proxy 
and it is working. I also wanted to implement throttling rules using 
throttler. So, I have used the sample available in documentation to 
restrict 3 requests in 10 seconds. The behavior that I have noticed is 
that it would "delay" the response after reaching the limit. However, I 
am wondering if there is a way to "block" the client for a certain 
period of time by sending a JSON response that the access is blocked as 
limits exceeded. Should I need to customize (or extend) the throttle to 
achieve this or somebody already got this requirement working? Thanks in 
advance.

Re: Throttler

Posted by Willem Jiang <wi...@gmail.com>.
I just commit a quick fix in master branch[1], as it’s a new feature for camel, I don’t have plan to merge it to other branches. You can merge it back to other camel branch if you like.

[1]https://issues.apache.org/jira/browse/CAMEL-7491

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On June 10, 2014 at 9:22:55 AM, Willem Jiang (willem.jiang@gmail.com) wrote:
>  
> Yes, Current Camel throttler implementation is based on the DelayProcessorSupport,  
> you need to extend the throttler to override the Delay behaviour.
>  
>  
> --
> Willem Jiang
>  
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>  
>  
>  
> On June 7, 2014 at 1:21:04 AM, Rallavagu (rallavagu@gmail.com) wrote:
> > All,
> >
> > I am evaluating Camel to be a proxy/gateway to REST internal end points.
> > I have set it up as a servlet on Tomcat and configured for http proxy
> > and it is working. I also wanted to implement throttling rules using
> > throttler. So, I have used the sample available in documentation to
> > restrict 3 requests in 10 seconds. The behavior that I have noticed is
> > that it would "delay" the response after reaching the limit. However, I
> > am wondering if there is a way to "block" the client for a certain
> > period of time by sending a JSON response that the access is blocked as
> > limits exceeded. Should I need to customize (or extend) the throttle to
> > achieve this or somebody already got this requirement working? Thanks in
> > advance.
> >
>  
>  


Re: Throttler

Posted by Willem Jiang <wi...@gmail.com>.
Yes, Current Camel throttler implementation is based on the DelayProcessorSupport, you need to extend the throttler to override the Delay behaviour.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On June 7, 2014 at 1:21:04 AM, Rallavagu (rallavagu@gmail.com) wrote:
> All,
>  
> I am evaluating Camel to be a proxy/gateway to REST internal end points.
> I have set it up as a servlet on Tomcat and configured for http proxy
> and it is working. I also wanted to implement throttling rules using
> throttler. So, I have used the sample available in documentation to
> restrict 3 requests in 10 seconds. The behavior that I have noticed is
> that it would "delay" the response after reaching the limit. However, I
> am wondering if there is a way to "block" the client for a certain
> period of time by sending a JSON response that the access is blocked as
> limits exceeded. Should I need to customize (or extend) the throttle to
> achieve this or somebody already got this requirement working? Thanks in
> advance.
>