Results 1 to 3 of 3

Thread: Clarification needed with Spring batch concepts

  1. #1
    Join Date
    Nov 2007
    Posts
    177

    Default Clarification needed with Spring batch concepts

    Hello,

    I am new at Spring batch and I am having an issue implementing my business use case with Spring batch.

    Basically, I am reading data from a database i.e. a List of subscribers to a newsletter. I then need to send an email to each subscriber as well as to insert data into the database in order to know which subscriber the email was sent to.

    I use an ItemProcessor implementation whose process method returns a MimeMessage and takes a subscriber as an argument; the writer associated with this processor is of type: org.springframework.batch.item.mail.javamail.MimeM essageItemWriter.

    The issue is that I need another writer for the database inserts (possibly using a CompositeItemWriter) that takes a List of subscribers as an argument and all I have as input is a MimeMessage from the above ItemProcessor.

    Can anyone please help?

    Regards,

    Julien.

  2. #2
    Join Date
    May 2011
    Location
    New Delhi, India
    Posts
    157

    Default

    You will have to move the processing that you are doing in the processor to the writer, then using the CompositeItemWriter you will be able to send message & write to database for the same user.

  3. #3
    Join Date
    Nov 2007
    Posts
    177

    Default

    Quote Originally Posted by rishishehrawat View Post
    You will have to move the processing that you are doing in the processor to the writer, then using the CompositeItemWriter you will be able to send message & write to database for the same user.
    Thanks for the reply.

Posting Permissions

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