Configuring the Scheduled Task Thread Pool
Tasks executed by @Scheduled
are by default run on a ScheduledExecutorService that is configured to have twice the number of threads as available processors.
You can configure this thread pool as desired using application.yml
, for example:
Configuring Scheduled Task Thread Pool
micronaut:
executors:
scheduled:
type: scheduled
core-pool-size: 30
Property | Type | Description |
---|---|---|
| java.lang.String | Sets the executor name. |
| java.lang.Integer | |
| Sets the executor type. Default value (SCHEDULED). | |
| java.lang.Integer | Sets the parallelism for WORK_STEALING. Default value (Number of processors available to the Java virtual machine). |
| java.lang.Integer | Sets the core pool size for SCHEDULED. Default value (2 Number of processors available to the Java virtual machine). |
| java.lang.Class | Sets the thread factory class. |
| java.lang.Integer | Sets the number of threads for FIXED. Default value (2 * Number of processors available to the Java virtual machine). |