I am using Spring batch to download a big file in order to process it.
the scenario is pretty simple:
1. Download the file via http
2. process it(validations,transformations)
3. send it into queue
- no need to save the input file data.
- we might have multiple job instances(of the same scenario) running in the same time
I am looking for best practice to handle this situation.
Should I create Tasklet to download the file locally and than start processing it via regular steps?
in that case I need to consider some temp-file-concerns
(make sure I delete it, make sure i am not overriding other temp filename, etc..)
In other hand I could download it and keep it in-memory but than I afraid that if I run many jobs instances ill be out of memory very soon.
How would you suggest to nail this scenario ?? Should I use tasklet at all?
thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…