title: How to prioritize and throttle requests in Java?
body: <p>My application handles Web Service requests(real time requests and a batch program firing requests) and calls an external system to retreive data.
  External system has a limit on requests, it can handle x calls in y seconds.</p>
  
  <p>Not only I need to throttle but need to prioritize the requests as well. I need to make sure Real time requests have precedence over batch requests.</p>
  
  <p>Our application is running on clustered Jboss server. What is the best way to prioritize and throttle the requests?</p>