Limit request on a Restlet resource with APISpark restlet extension
Here's my code to limit the number of request for minute: MethodAuthorizer ma = createMethodAuthorizer(); ma.setNext(router); FirewallRule rule = new PeriodicFirewallCounterRule(60, TimeUnit.SECONDS, new IpAddressCountingPolicy()); ((PeriodicFirewallCounterRule)rule).addHandler(new RateLimitationHandler(new UniqueLimitPolicy(10))); FirewallFilter firewallFiler = new FirewallFilter(getContext(), list(rule)); firewallFiler.setNext(ma); return ma; The problem is that there is no error, but even if more than 10 request is requested from the resource still it does not throw "Too Many Request" I