title: JAXRS / RestEasy Limit rate of requests
body: <p>I have a Restful API that is used for uploading some files via POST to a server from remote nodes</p>
  
  <p>If I take the server down the uploads are queued remotely so that when the server comes back online there may be a large amount of requests coming in that can bring down the server</p>
  
  <p>The application is hosted across a cluster of JBoss servers with an Apache front end</p>
  
  <p>So my question is: Are there any built-in/efficient solutions for limiting the number of concurrent requests? Either at the Apache / JBoss / RestEasy - Application level</p>
  
  <p>At the moment, the API called has to return a 200 (Success) otherwise the upload stays in the remote queue and will retry after a fixed time period</p>
  
  <p>I am thinking of just storing the current number of requests in the database and setting a threshold, if the theshold is exceeded then reject the request so that the remote node trys again after an amount of time, but I was hoping there would be a more elegant solution</p>