У меня есть приложение Spring Boot 2.1.8, которое использует @Async
-Задания. Все задачи @Async
выполнялись автоматически настроенным ThreadPoolTaskExecutor
бином с именем applicationTaskExecutor
.
Что я изменил? С spring-boot-starter-websocket
в пути к классам ив конфигурации @EnableWebSocketMessageBroker
applicationTaskExecutor
-фас исчезает и заменяется четырьмя бобами с именами
clientInboundChannelExecutor
, clientOutboundChannelExecutor
, brokerChannelExecutor
, - и
messageBrokerTaskScheduler
.
Журналы Spring для консоли: AnnotationAsyncExecutionInterceptor : More than one TaskExecutor bean found within the context, and none is named 'taskExecutor'. Mark one of them as primary or name it 'taskExecutor' (possibly as an alias) in order to use it for async processing: [clientInboundChannelExecutor, clientOutboundChannelExecutor, brokerChannelExecutor, messageBrokerTaskScheduler]
@Async
-задачи теперь выполняются SimpleAsyncTaskExecutor
.
Вопрос Почему не все бобы могут сосуществовать? Почему Spring не создает applicationTaskExecutor
-bean при настройке spring-websockets?