I have several REST services and Web services. I would like to intercept all requests to all services. My purpose is trying to calculate the rate of requesting to a specific services from a source or an IP address for example. If a same user or client app requests an operation of a service too often than allow, then the request will be rejected.
Anyone has any idea?
I am thinking about having a custom filter in Jetty.xml. Is this sound right? How about pax-web?
You have cThrottler that could be a workaround for what you want to do.
You can also store some stats in a DB or a static java object (but that will only exist in its route and not the others)
You can use Hazelcast to share java data among routes.
Thank for the reply. I already looked at cThroller, but it does not meet my need. I need a system wise intercept to all requests to route REST service and web service per user. I think the custom jetty handler will do the job, but I have not successfully create my custom handler jar file to load correctly. My handler extends the HandlerWrapper ( as it similar to the built-in IPAccessHandler of Jetty, but I have hard time to make my jar load correctly and I think it is some thing to due with maven build which I have not work with it before.