<p>I want to define thread count for my fixed thread pool in my spring application. Where should I do that? I am confused between yaml and application.properties files.</p>

darkstar
<p>You should define the thread count for your fixed thread pool in the <code>application.properties file</code>. This is the default configuration file for Spring applications, and it is the recommended place to store configuration settings. You can specify the number of threads for your fixed thread pool with the property <code>spring.task.execution.pool.core-size</code>.</p>
<p>For example, if you wanted to define a fixed thread pool with 10 threads, you would add the following to your application.properties file: <code>spring.task.execution.pool.core-size=10</code></p>
<p>As per <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.yaml.mapping-to-properties" rel="nofollow noreferrer">Spring boot doc</a> :</p>
<blockquote>
<p>YAML files cannot be loaded by using the @PropertySource or
@TestPropertySource annotations. So, in the case that you need to load
values that way, you need to use a properties file.</p>
</blockquote>
<p>Refer to this <a href="https://stackoverflow.com/a/47464820/19230181">SO1</a> and <a href="https://stackoverflow.com/a/58407832/19230181">SO2</a> to know the difference between yaml and application.properties files.</p>
