Is there anyway to be able to specify different Executors for different classes? Seems a bit constricting to have to use one Executor for every async task.
2 Answers
You can have several instances of the same task executor type (Pool). But you can not have different Pools.
For example
<task:executor id="executor" pool-size="10"/>
10 instances of ThreadPoolTaskExecutor
or
<task:executor id="executorWithPoolSizeRange"
pool-size="5-25"
queue-capacity="100"/>
For more details see the spring Reference @see Spring Reference Chapter 25 Task Execution and Scheduling