简体   繁体   English

Spring 批处理:如何实现多对一的ItemProcessor

[英]Spring Batch: How to implement a many-to-one ItemProcessor

I have a very large set of spreadsheets that need to be generated using spring batch.我有大量需要使用 spring 批处理生成的电子表格。

I have an ItemReader emitting "Rows", and I would like my ItemProcessor to emit 1 "Sheet" for every 3000 Rows it receives.我有一个 ItemReader 发出“Rows”,我希望我的 ItemProcessor 为它收到的每 3000 Rows 发出 1 个“Sheet”。

Is there any way to specify this many-to-one processing relationship to spring?有什么方法可以指定这种与 spring 的多对一处理关系吗?

It is not a "many-to-one ItemProcessor" that you need.它不是您需要的“多对一 ItemProcessor”。 You can use a chunk oriented step with a chunk size of 3000 (this should be ok) with an item writer that writes a sheet per chunk.您可以使用块大小为 3000 的面向块的步骤(这应该没问题)和一个项目编写器,它为每个块写入一张表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM