title: Difference between Spring Boot ThreadPoolTaskExecutor and server.tomcat.max-threads property
body: <p>I've read that number of maximum threads for a server can be specified using <code>server.tomcat.max-threads</code> in the application.properties file. </p>
  
  <p>If that is the case, what is the use of specifying <code>maxPoolSize</code> in <code>ThreadPoolTaskExecutor</code> if the other property is the one that defines maximum threads available to the server?</p>
  
  <p><strong>Example code for TaskExecutor:</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
  executor.setCorePoolSize(2);
  executor.setMaxPoolSize(2);
  executor.setQueueCapacity(500);
  </code></pre>