Results 1 to 5 of 5

Thread: With no Writing

  1. #1
    Join Date
    Aug 2008
    Posts
    7

    Question With no Writing

    Dear friends

    I am not familiar with Spring batch. I want to develop a batch processing module. But my module does not have write phase. Is Spring Batch using suitable for me? I want to read some file (for example .csv file) and I want to do a business logic on the records. My module need some functionality such as skipping, resting, etc. But there is no "write" phase. Please help me.
    Regards

  2. #2
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    How can you be processing an input file and not generating any results? What is the point of the business logic?

  3. #3
    Join Date
    Aug 2008
    Posts
    7

    Default Sending SMS

    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.

  4. #4
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Quote Originally Posted by sama167 View Post
    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.

  5. #5
    Join Date
    Aug 2008
    Posts
    7

    Default

    Thanks chudak.

Posting Permissions

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