In a spring component, i have this method:
@Async("@taskExecutorFactory.getOrCreate(#taskId)")
public void updateTask(String taskId) {
// update code
}
I would like to use a different executor for each call. The executor is provide by the TaskExecutorFactory
bean according to the taskId
.
The expression @taskExecutorFactory.getOrCreate(#taskId)
is not recognized by spring at startup with the error:
A component required a bean named '@taskExecutorFactory.getOrCreate(#chainTaskId)'
that could not be found.
Any ideas if this is possible?