Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit web services usage in Java application?

Suppose I have a Java server application, which implements a few web services. Suppose also, I can authenticate application users.

Now I would like to add some limits per user to the service usage: e.g. rate limit (requests per second), maximum request size, etc.

Is there any "ready-to-use" library in Java to do that?

like image 210
Michael Avatar asked Sep 24 '12 15:09

Michael


1 Answers

You can do that with Apache CXF by configuring an interceptor. This page has an example of the high level configuration. This page has details on interceptors. You can get as fancy as you wish with your validation. I do not know off hand how to get the authenticated user.

like image 165
Martin Serrano Avatar answered Sep 20 '22 19:09

Martin Serrano