title: In a existing spring-boot application, run a infinite loop in a seperate thread
body: <p>I have a existing spring-boot service(hosting many apis) with following main class.</p>
  
  <pre><code>@SpringBootApplication
  public class BusinessRules {
  
      public static void main(String[] args) {
          SpringApplication.run(BusinessRules.class, args);
      }
  }
  </code></pre>
  
  <p>As a new requirement, I need to consume SQS messages from two different SQS queues in separate threads(via infinite loop) within this same service. Can I simply add new two new thread using ExecutorService. Something like this:</p>
  
  <pre><code>@SpringBootApplication
  public class BusinessRules {
  
      public static void main(String[] args) {
          SpringApplication.run(BusinessRules.class, args);
          //new code
          ExecutorService executor = Executors.newFixedThreadPool(2);
          Runnable runnable1 = new SQSMessageProcessor1(); //infinite loop in run method
          Runnable runnable2 = new SQSMessageProcessor2(); //infinite loop in run method
          executor.execute(runnable1);
          executor.execute(runnable2);
      }
  }
  </code></pre>
  
  <p>Are there any issues with the above code or any other better alternatives available.</p>