Announcement Announcement Module
Collapse
No announcement yet.
Clarification needed with Spring batch concepts Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


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

      Comment

      Working...
      X