Feb 12th, 2013, 04:13 AM
Where/How to plug a gzip stage afterwards ?
I need to gzip files which have been generated by a customized ItemWriter, in a previous step.
All the new generated files (XML ones) would be gathered and gzipped.
Where and how do you think i could plug this ? In a new next step ?
Is there any concept of ItemReader on a directory, where a so-called item would be a file ?
(and so potentially harness the retry feature)
Thanks in advance
Last edited by Akamanouche; Feb 12th, 2013 at 04:30 AM.
Feb 12th, 2013, 08:50 AM
The FlatFileItemReader exposes a buffereredReaderFactory which makes it easy to plugin a GZip Reader. But the FlatFileItemWriter isn't as kind. I think this is because the writer wants to preserve state information, so it implements a TransactionAwareBufferedWriter, https://github.com/SpringSource/spri...temWriter.java. Seems like the best bet would be to implement a Tasklet that knows how to compress the output of the previous step.
Feb 12th, 2013, 09:47 AM
We actually have a Jira issue open for this very use case: https://jira.springsource.org/browse/BATCH-1750
We'd love any contributions anyone is willing to offer on this!
Tags for this Thread