Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch ItemReader control Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch ItemReader control

    Hi,
    We have a simple scenario where we have to control the execution/ termination of the "ItemWriter" based on the file size of the file used by "FlatFileReader".

    We are using the "FlatFileReader" to read from a csv file and "JdbcBatchItemWriter" to write into the oracle database.

    Since the writing into the DB is always comparatively expensive, I thought of mitigating the cost of executing the ItemWriter if the file is 0kb.

    Please let me know, if spring batch has a solution for this scenario and if it does, please let me know how to configure/ write code to get this done.


    Thanks

  • #2
    Hi,
    I suppose FlatFileReader don't read anything and don't kick Writer if file ist 0kb (emphy). If not so, just extend the FlatFileReader to ignore 0Kb file

    ticino

    Comment


    • #3
      Originally posted by Krishna Das View Post
      Hi,
      Since the writing into the DB is always comparatively expensive, I thought of mitigating the cost of executing the ItemWriter if the file is 0kb.
      What does the reader read, an empty String ?
      What does the writer write in your usecase ?

      Comment

      Working...
      X