Announcement Announcement Module
Collapse
No announcement yet.
With no Writing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    How can you be processing an input file and not generating any results? What is the point of the business logic?

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          Thanks chudak.

          Comment

          Working...
          X