title: How to make sure every API calls are served (Queueing Rest API calls)?
body: <p>I am developing a REST API in Spring Boot which I am providing the response within mostly 1-3 sec.My Controller is like below:</p>
  
  <pre><code>@RestController
  public class ApiController {
      List&lt;ApiObject&gt;  apiDataList;   
  
      @RequestMapping(value="/data",produces={MediaType.APPLICATION_JSON_VALUE},method=RequestMethod.GET)
      public ResponseEntity&lt;List&lt;ApiObject&gt;&gt; getData(){                                       
          List&lt;ApiObject&gt; apiDataList=getApiData();
          return new ResponseEntity&lt;List&lt;ApiObject&gt;&gt;(apiDataList,HttpStatus.OK);
      }
      @ResponseBody   
      public List&lt;ApiObject&gt;  getApiData(){
          List&lt;ApiObject&gt;  apiDataList3=new List&lt;ApiObject&gt; ();
          //do the processing
          return apiDataList3;
      }
  }
  </code></pre>
  
  <p>So I have a 300 users concurrently loading the API.I performed the load test with JMeter and it was ok.But still there were some failures(not all API calls were served).So how do I overcome this?How to imlement any queue on the API calls which arrives or any other methods to ensure each API call is responded with data?</p>