AFAIK, no mechanism is implemented in Tomcat to limit the number of concurrent requests for a specific request.
I think your only option is to implement a Semaphore mechanism to control the max number of requests executing your service. Once implemented, you could have something like:


public class YourService {
 static private final MAX_REQUESTS = 3;  // for example

private Semaphore sem = new Semaphore(MAX_REQUESTS);

 public yourMethod() {
   sem.acquire();
   try {
     // your code here
   }
   finally {
     sem.release();
   }
 }
}

For an implementation of Semaphores and other concurrency control structures, you can see

http://gee.cs.oswego.edu/dl/cpj/

There you will find a link to the "util.concurrent" library.

Hope this helps,
Rodrigo Ruiz

John Green wrote:

Hello, I am using JBoss, Tomcat, and AXIS 1.1. Is there a way to limit the max number of concurrent requestings for a specific web service? I have one that it a huge memory hog, and processing just a few message concurrently can cause out of memory exceptions.
Thanks.
------------------------------------------------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now <http://us.rd.yahoo.com/slv/mailtag/*http://companion.yahoo.com/>





Reply via email to