mkopylec / charon-spring-boot-starter

Reverse proxy implementation in form of a Spring Boot starter.
Apache License 2.0
246 stars 55 forks source link

Runtime Exception "No qualifying bean of type 'org.springframework.core.task.TaskExecutor'" #62

Closed torsten-liermann closed 6 years ago

torsten-liermann commented 6 years ago

The factory below will never produce an task executor object if isAsynchronousMappingPresent is false.

@Bean
    @ConditionalOnMissingBean
    public TaskExecutor charonTaskExecutor() {
        if (isAsynchronousMappingPresent()) {
            ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
            taskExecutor.setQueueCapacity(charon.getAsynchronousForwardingThreadPool().getQueueCapacity());
            taskExecutor.setCorePoolSize(charon.getAsynchronousForwardingThreadPool().getSize().getInitial());
            taskExecutor.setMaxPoolSize(charon.getAsynchronousForwardingThreadPool().getSize().getMaximum());
            return taskExecutor;
        }
        return null;
    }

Maybe just a problem with the spring-boot 2.x.x.

In my old migration hack you can see my workaround

For information: Spring uses the bean name as a default qualifier value. I think the qualifier annotation is superfluous, if you rename the parameters.

mkopylec commented 6 years ago

Fixed in 3.0.1