title: Multi-thread @Scheduled Springboot
body: <p>I have an application running now using @scheduled and the threadPoolTaskScheduler.</p>
  
  <p>My configuration class:</p>
  
  <pre><code>@Configuration
  @EnableScheduling
  public class AppConfig {
  
      @Bean(destroyMethod = "shutdown")
      public ThreadPoolTaskScheduler taskScheduler() {
          ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
          taskScheduler.setPoolSize(10);
          return  taskScheduler;
      }
  
  }
  </code></pre>
  
  <p>My task:</p>
  
  <pre><code>@Scheduled(fixedRate = 5000)
      public void execute() {
           //do stuff
           //call a webservice
  }
  </code></pre>
  
  <p>In the execute method I do some stuff and call a external webservice, this webservices have a limmitation, I cant use more than 10 threads per webservice call. And now I need to create another 3 methods like the execute (and make one external webservice call for for each of these "execute" methods).</p>
  
  <p>So I have a total of 40 threads that I can use, but limited by 10 for each method.</p>
  
  <p>I am wondering if there is some way to have one thread pool for each @scheduled method. Could you guys help me with that?</p>
  
  <p>Thanks.</p>