-
Notifications
You must be signed in to change notification settings - Fork 270
Description
Adding spring-boot-starter-websocket dependency to an embabel application and this config:
@Configuration
@EnableWebSocketMessageBroker
class WebSocketBrokerConfig : WebSocketMessageBrokerConfigurer {
override fun configureMessageBroker(registry: MessageBrokerRegistry) {
registry.enableSimpleBroker("/topic") // responses to clients
registry.setApplicationDestinationPrefixes("/app") // client messages to server
}
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
registry.addEndpoint("/ws-chat")
.setAllowedOrigins("*")
.withSockJS()
}
}gives in this error:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncer' defined in class path resource [com/embabel/agent/spi/config/spring/AsyncConfiguration.class]: Unsatisfied dependency expressed through method 'asyncer' parameter 0: No qualifying bean of type 'java.util.concurrent.Executor' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier("applicationTaskExecutor")}
Workaround was to create this bean:
@Bean(name = [TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME])
@Qualifier(TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME)
fun applicationTaskExecutorVirtualThreads(builder: SimpleAsyncTaskExecutorBuilder): SimpleAsyncTaskExecutor? {
return builder.build()
}I only created this issue, because using websockets seems to be a good option for an agent application for me.