First, see this post for one method to obtain the ip address of your caller 
using a GenericHandler.

http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935845#3935845

Using this method, you can essentially (by creating a class that extends 
GenericHandler) intercept any web-services calls to any web-service that we 
want intercepted (based on QName).

So, once we have an ip, we could call query a database, or run some other logic 
inside of our handler, and dermine how many calls per hour, minute, etc a given 
ip has made.  If an ip has exceeded a given threshold, then simply don't call 
the "super.handleRequest(context)" function (this is in the override of the 
"public boolean handleRequest(MessageContext context)" in GenericHandler -- see 
the referenced post above.  However, if the ip has not exceeded our threshold, 
then by calling super.handleRequest(..), our SEI is called, and the web-service 
call proceeds normally.

I'd appreciate hearing any other alternatives you might find for throttling a 
web-service...I'm looking for some best practices, too.

Thanks!

David



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935848#3935848

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3935848


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to