I've started evaluating Spring Batch and it looks promising. I've worked on several projects that do a fair amount of file batch processing. From my experience, there are a some features that the framework needs to support before I can comfortably recommend that our group use it.
Specifically, does the framework support:
- native database bulk-copy commands like Sybase "bcp" or Oracle "bulk load"? For us it's fine if this breaks the transaction boundary demarcations.
- multiple record types (i.e. header/detail-rectype-1/detail-rectype-2/trailer)?
- optional vs required fields (I assume you'd have to use something like the ValidatingItemProvider for this)
- optional vs required record types (I assume you'd have to use something like the ValidatingItemProvider for this)
- field padding (left vs right and padding char)
- field masks (i.e. mask="MM/dd/yy", or masks similar to the java.text.Format)
- field-by-field default values for empty/null fields (i.e. if field1 is empty or blank, default it to today)
- On delimited files, what about files that use different delimeters for separating each field (i.e. field1~field2|field3|field4!lastfield/n). Perhaps the FieldSet class could contain an attribute for that info?
- Record separators for files that don't use a CR or CR/LF for the end of the line (i.e. field1|field2|field3|field4!lastfieldinrecord~). Perhaps the solution is to use the RecordSeparatorPolicy and/or SuffixRecordSeparatorPolicy?
- What if you want to do multi passes of the file - one to validate it (especially useful for files containing multiple record types), then one to process it?
I'm very familiar with Spring but Spring Batch is totally new to me so perhaps it does support what I'm asking and I just overlooked how to accomplish what I'd like.
Can someone please help point me at an example of how to do some of the things I have a question on?


Reply With Quote
