
Originally Posted by
sama167
For Example, I want to read customer table and send a SMS to whom has a specific attribute. This is a batch process with no writing phase.
Sending an sms message is essentially a write. You'd have your reader read every record and your writer would make a decision about what to do with the record (e.g. if it passes some criteria, send the sms message):
Code:
public class SmsWriter implements ItemWriter
{
public void write(Object o) throws Exception
{
if (passesSomeCriteria(o))
{
doWrite(o);
}
}
}
The framework doesn't really care if your writer actually writes something for every record it reads; however, it WILL invoke your writer for every record.