java - 无法为异步配置配置线程池任务执行器
问题描述
我有一些大文件要从 REST 调用中下载。我发现spring 使用异步方式通过产生另一个线程StreamingResponseBody
直接写入响应。OutputStream
这提高了性能。但是,我收到一个关于配置线程池任务执行器的错误,因为默认值SimpleAsyncTaskExecutor
在负载下不好。我已经配置了线程池并实现AsyncConfigurer
了覆盖方法configureAsyncSupport
。尽管进行了所有这些配置,但我无法使用 threadpool ,但正在使用默认的 asyncExecutor 。
教程如下:- https://dzone.com/articles/streaming-data-with-spring-boot-restful-web-servic
PS我没有使用springboot
解决方案
推荐阅读
- postgresql - pg_dump 在 Linux 上工作,但给 Windows 错误
- ios - 裁剪 CMSampleBuffer 并处理它而不转换为 CGImage
- go - Kallax:包不在任何 go 路径中
- javascript - //未捕获的错误:选择颜色不是函数 - 我找不到错误
- apache-kafka - Kafka Admin:如何以编程方式显示和设置每个主题的保留时间?
- vbscript - VBS 中的 Sendkeys 在 telnet 会话中无法正常工作
- python - 如何在 gtk3 glarea 中集成 pyglet opengl 上下文?
- ruby - 使用 Open3 从 Ruby 中的可执行文件中检索退出状态值
- scala - Scala:特征中的抽象比较方法
- python-3.x - Tensorflow:定义 tf 常量时出现无效类型错误