Spring batch 等待池I/O连接超时错误-org.springframework.web.client.ResourceAccessException

Spring batch 等待池I/O连接超时错误-org.springframework.web.client.ResourceAccessException,spring-batch,Spring Batch,在Itemprocessor内使用spring批处理和以下配置调用CompletableFuture内的API时出现异常。 代码片段是,我正在对ItemReader、ItemProcessor和ItemWriter使用批处理步骤 @Bean public Step batchStep() { return stepBuilderFactory.get("batchStep").<String, ProcessorData>chunk(10) .reader(reade

在Itemprocessor内使用spring批处理和以下配置调用CompletableFuture内的API时出现异常。 代码片段是,我正在对ItemReader、ItemProcessor和ItemWriter使用批处理步骤

@Bean
public Step batchStep() {
return stepBuilderFactory.get("batchStep").<String, ProcessorData>chunk(10)
        .reader(reader()).processor(processor()).writer(writer())
        .listener(batchStepListener())
        .taskExecutor(taskExecutor())
        .build();
}

@Bean
public TaskExecutor taskExecutor() {
   SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
   taskExecutor.setConcurrencyLimit(50);
   return taskExecutor;
}
@Bean
公共步骤batchStep(){
返回stepBuilderFactory.get(“batchStep”).chunk(10)
.reader(reader()).processor(processor()).writer(writer())
.listener(batchStepListener())
.taskExecutor(taskExecutor())
.build();
}
@豆子
公共任务执行器任务执行器(){
SimpleAsyncTaskExecutor taskExecutor=新的SimpleAsyncTaskExecutor();
taskExecutor.setConcurrencyLimit(50);
返回任务执行器;
}
在ItemProcessor中,我使用CompletableFuture跨越了4个以上的操作,以执行特定用例,并将CompletableFuture.allOf(..)返回给ItemWriter,在其中我获取各个状态并提交给DB。下面是ItemProcessor代码段

@Override
public ProcessorData process(String tenant) {

CompletableFuture<String> operationA = operation.fetchA(tenant);

CompletableFuture<String> operationB = operation.fetchB(tenant);

CompletableFuture<String> operationC = operation.fetchC(tenant);

CompletableFuture<String> operationD = operation.fetchD(tenant);

CompletableFuture<Void> combinedFuture = CompletableFuture.allOf(operationA, operationB, operationC,
        operationD);

return new ProcessorData(operationA, operationB, operationC, operationD, idmeventsBackup,
        combinedFuture);
}
@覆盖
公共进程数据进程(字符串租户){
CompletableFuture operationA=operation.fetchA(租户);
CompletableFuture operationB=operation.fetchB(租户);
CompletableFuture operationC=operation.fetchC(租户);
CompletableFuture operationD=operation.fetchD(租户);
CompletableFuture combinedFuture=CompletableFuture.allOf(操作A、操作B、操作C、,
操作d);
返回新的处理器数据(操作A、操作B、操作C、操作D、idmeventsBackup、,
结合未来);
}
例外情况如下:

org.springframework.web.client.ResourceAccessException: I/O error on DELETE request for <URL>:
Timeout waiting for connection from pool; nested exception is
org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:744)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:670)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:579)
org.springframework.web.client.ResourceAccessException:删除请求时发生I/O错误:
等待来自池的连接超时;嵌套异常是
org.apache.http.conn.ConnectionPoolTimeoutException:等待来自池的连接的超时
位于org.springframework.web.client.restemplate.doExecute(restemplate.java:744)
位于org.springframework.web.client.restemplate.execute(restemplate.java:670)
位于org.springframework.web.client.restemplate.exchange(restemplate.java:579)

这是否回答了您的问题?这回答了你的问题吗?