title: Not able to process request after multiple thread creation
body: <p>Created a static ExecutorService object and used it to execute an async task with input in a spring boot rest controller. not able to process any request after invoking async task for 3 times.</p>
  
  <p><strong>TaskManager.java</strong></p>
  
  <pre><code>public class TaskManager {
      static ExecutorService e = Executors.newFixedThreadPool(4);
      private TaskManager(){
  
      }
      public static void addAsyncTask(AsyncTaskWrapper task){
          e.submit(task);
      }
  }
  </code></pre>
  
  <pre><code> public class AsyncTaskWrapper implements Callable {
      Object input,output;
      Callable callback;
      AsyncTask task;
      public Object getInput() {
          return input;
      }
  
      public void setInput(Object input) {
          this.input = input;
      }
  
      public Object getOutput() {
          return output;
      }
  
      public AsyncTask getTask() {
          return task;
      }
  
      public void setTask(AsyncTask task) {
          this.task = task;
      }
  
      public Callable getCallback() {
          return callback;
      }
  
      public void setCallback(Callable callback) {
          this.callback = callback;
      }
  
      public AsyncTaskWrapper(AsyncTask task, Callable callback){
          this.callback = callback;
          this.task = task;
      }
  
      @Override
      public Object call() throws Exception {
          System.out.println("Started");
          output = task.execute(input);
          callback.call();
          System.out.println("call completed");
          return output;
      }
  }
  
  </code></pre>
  
  <p><strong>RESTControllers.java</strong> - need to execute a task in async with input for a RESTEndpoint.</p>
  
  <pre><code>AsyncTaskWrapper task = new AsyncTaskWrapper(
      (list) -&gt; {
          List l = (List) list;
          try {
                  MailingUtils.sendRegistrationMail((String) l.get(0), (String) l.get(1));
          } catch (MessagingException e) {
                  e.printStackTrace();
          }
          return null;
      },
      () -&gt; {
          System.out.println("Done");
          return null;
      });
  
  task.setInput(objects);
  TaskManager.addAsyncTask(task);
  </code></pre>
  
  <p>Thanks in advance</p>