Results 1 to 3 of 3

Thread: Where/How to plug a gzip stage afterwards ?

  1. #1
    Join Date
    Feb 2013
    Posts
    5

    Default Where/How to plug a gzip stage afterwards ?

    Hi,

    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.

  2. #2

    Default

    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.

  3. #3
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    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!
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •