[英]Spring batch MultiResourceItemReader - only used for combining files?
I have a Spring batch operation where I have sources file1
, file2
and file3
to read from, and want to write to fileA
, fileB
and fileC
like the following: 我有一个Spring批处理操作,其中有要读取的源
file1
, file2
和file3
,并且想要写入fileA
, fileB
和fileC
,如下所示:
file1->fileA
file2->fileB
file3->fileC
When I look at an example for MultiResourceItemReader
it implies that the [MultiResourceItemReader][2]
is useful for combining operations - but not pipelining parallel operations. 当我看一看
MultiResourceItemReader
的示例时,它暗示[MultiResourceItemReader][2]
对于合并操作很有用,但对管道化并行操作则无效。 ie the usage pattern of MultiResourceItemReader
is for appending: 即
MultiResourceItemReader
的使用模式用于附加:
file1->file2->file3->fileC
If I want to read a sequence of files as separate operations- is MultiResourceItemReader
still the way to go? 如果我想读取一系列文件作为单独的操作
MultiResourceItemReader
还是要走的路吗?
您可以使用multiresourceparitioner,它是并行和异步的,请在这里参考spring batch示例程序
MultiResourceItemReader: MultiResourceItemReader:
Reads items from multiple resources sequentially - resource list is given by setResources(Resource[]), the actual reading is delegated to setDelegate(ResourceAwareItemReaderItemStream).
So the job of MultiResourceItemReader is correctly done. 因此,MultiResourceItemReader的工作已正确完成。
The problem is after delegating reading to the actual reader. 问题出在将阅读委派给实际读者之后。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.