I am trying to add a header and footer in a custom writer by implementing the header callback and footercallback in my custom writer call .
Write method is successful . But write header and writefooter are not called .
public class CustomOAFileItemWriter extends StepExecutionListenerSupport implements ItemWriter<OAExtract>,FlatFileHeaderCallback,FlatFileFooterCallback{
public void write(List<? extends OAExtract> oaExtractList) throws Exception {
FileOutputStream fs = new FileOutputStream("C:\\archivedFiles\\out.bin");
}
public void writeHeader(Writer writer) throws IOException {
System.out.println("Writing Header record");
}
public void writeFooter(Writer writer) throws IOException {
System.out.println("Writing Footerrecord");
}
Can someone with Spring batch experience help me with this?
Thanks, Rai