0
votes

Currently i am working on a Spring Integration application which has a following scenario.

  1. There is a Transformer which transforms incoming message in to a particular object type
  2. Once the transformation is done, we need to write it to a log file and to a database table and then finally send to a JMS outbound adapter.

I was reading the Spring Integration reference and found out there are two ways we can approach this scenario.

  1. Introduce a pub-sub channel as the output channel of the above mentioned transformer and have File-outbound, DB-outbound and JMS-outbound as the subscribers.
  2. Introduce a Recipient List Router just after the transformer and specify the File-outbound, DB-outbound and JMS-outbound as the recipients.

When it comes to Enterprise Integration Patterns what is the best way to handle this scenario? Any new suggestions and improvements are welcome

Thanks, Keth

1

1 Answers

1
votes

There is no "best way" - both solutions are equivalent and there is little difference at runtime. So it's your preference; I generally use pub/sub for the simple case and an RLR if the recipients are conditional (with selectors).