How to skip lines with ItemReader in Spring-Batch?

后端 未结 5 821
陌清茗
陌清茗 2021-01-16 15:39

I have a custom item reader that transforms lines from a textfile to my entity:

public class EntityItemReader extends AbstractItemStreamItemReader

        
5条回答
  •  孤街浪徒
    2021-01-16 16:18

    I do not think you can have your cake and eat it too in this case (and after reading all the comments). By best opinion would (as suggested) to throw a custom Exception and skip 'on it'. You can maybe optimize your entity creation or processes elsewhere so you don't loose so much performance. Good luck.

提交回复
热议问题