I have a scenario that following below steps:
1. The reader will get a list A from table A.
2. The processor processes list A to return object A and MimeMessage.
3. The writer writes object A into table B and use MimeMessage to send mail.
Could I use CompositeItemProcessor and CompositeItemWriter for my scenario above? If yes, how can I set the output object in Step configuration and how to define which ItemWriter for send mail will take MimeMessage and ItemWriter for insert database will take object A.
Are there any better solutions for my problem?