javaspringthreadpoolexecutorspring-async

What are the defaults in Spring @Async?


Could you tell me what are the default parameters for Spring @Async ThreadPoolTaskExecutor or how can I find them one my own?

What are the default values for maxPoolSize, corePoolSize, and queueCapcity?

Should I override them to improve my application or is it just fine to use default values?


Solution

  • Regarding ThreadPoolTaskExecutor's implementation. You can check it at their github repository. ThreadPoolTaskExecutor

    private int corePoolSize = 1;
    
    private int maxPoolSize = Integer.MAX_VALUE;
    
    private int queueCapacity = Integer.MAX_VALUE;