ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
CompletableFuture.supplyAsync(() -> {
RequestContextHolder.setRequestAttributes(servletRequestAttributes, true);//设置子线程共享
// ...业务代码
}, payQueueThreadPool); // payQueueThreadPool自定义线程池
}
解决No thread-bound request found: Are you referring to request attributes outside of an actual web.异常
最新推荐文章于 2023-03-14 10:38:47 发布