首页 > 解决方案 > 无法为异步配置配置线程池任务执行器

问题描述

我有一些大文件要从 REST 调用中下载。我发现spring 使用异步方式通过产生另一个线程StreamingResponseBody直接写入响应。OutputStream这提高了性能。但是,我收到一个关于配置线程池任务执行器的错误,因为默认值SimpleAsyncTaskExecutor在负载下不好。我已经配置了线程池并实现AsyncConfigurer了覆盖方法configureAsyncSupport。尽管进行了所有这些配置,但我无法使用 threadpool ,但正在使用默认的 asyncExecutor 。

教程如下:- https://dzone.com/articles/streaming-data-with-spring-boot-restful-web-servic

PS我没有使用springboot

标签: javaspringasynchronousconfigurationthreadpoolexecutor

解决方案


推荐阅读