大概意思是我一个接口里面需要连续调用7次远程同样的接口,只是传给接口的参数不一样,相互之间没有数据交互,使用的是同一个service里面同一个方法,其他不涉及共享变量
CompletableFuture<Void> operate4RenewFuture = CompletableFuture.runAsync(() -> {
this.testService.testMethod();
}, threadPoolExecutor);
线程池定义如下
@Bean
public ThreadPoolExecutor threadPoolExecutor(){
return new ThreadPoolExecutor(50, 500,
30, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(10000));
}
如果项目采用分布式部署,高并发情况下,这些异步任务之前会有线程安全性问题吗?