springcloud整合springboot-admin监控,报错

前提:整合教程网上一堆,admin监控网页显示这个监控服务down

控制台:

2019-10-18 16:25:55.465  WARN 18876 --- [io-8040-exec-10] o.s.w.s.m.m.a.ReactiveTypeHandler        : 
!!!
Streaming through a reactive type requires an Executor to write to the response.
Please, configure a TaskExecutor in the MVC config under "async support".
The SimpleAsyncTaskExecutor currently in use is not suitable under load.
-------------------------------
Controller:    de.codecentric.boot.admin.server.web.ApplicationsController
Method:        applicationsStream
Returning:    reactor.core.publisher.Flux>
!!!
2019-10-18 16:30:38.570  INFO 18876 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
 

 

 

解决办法:Please, configure a TaskExecutor in the MVC config under "async support".

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {


    @Override
    public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
        configurer.setDefaultTimeout(60 * 1000L);
        configurer.registerCallableInterceptors(timeoutInterceptor());
        configurer.setTaskExecutor(threadPoolTaskExecutor());
    }

    @Bean
    public TimeoutCallableProcessingInterceptor timeoutInterceptor() {
        return new TimeoutCallableProcessingInterceptor();
    }

    @Bean
    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
        ThreadPoolTaskExecutor t = new ThreadPoolTaskExecutor();
        t.setCorePoolSize(10);
        t.setMaxPoolSize(100);
        t.setQueueCapacity(20);
        t.setThreadNamePrefix("WYF-Thread-");
        return t;
    }
}

你可能感兴趣的:(springcloud)