title: run process in background using spring boot
body: <p>How can I run some process in background using Spring Boot? This is an example of what I need:</p>
  
  <pre><code>@SpringBootApplication
  public class SpringMySqlApplication {
  
      @Autowired
      AppUsersRepo appRepo;
  
      public static void main(String[] args) {
          SpringApplication.run(SpringMySqlApplication.class, args);
  
          while (true) {
              Date date = new Date();
              System.out.println(date.toString());
              try {
                  TimeUnit.SECONDS.sleep(3);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>