我有一个现有的spring-batch Step,我想用Async processor + writer来重构它。
StepBuilderFactory steps;
steps.get("test").chunk(1000)
.reader(new FlatFileItemReader<String>())
.processor(new AsyncItemProcessor<String, String>())
.writer(new AsyncItemWriter<String>())
.build();这不起作用,处理器会报错:
The method processor(ItemProcessor<? super Object,? extends Object>) in the type SimpleStepBuilder<Object,Object> is not applicable for the arguments (AsyncItemProcessor<String,String>)。
如何使用异步构建一个步骤?
发布于 2015-04-23 22:22:24
您需要将处理器的输出包装到AsyncItemProcessor的java.util.concurrent.Future中。
API
https://stackoverflow.com/questions/29825937
复制相似问题