I've got some instances where I want a Spring Integration component (a service activator) to take in a message with a File payload, and produce some output. Additionally, once the component has produced this output, I'd like to pass the original File message on to a different channel.
The use case is I've got some files coming in, being sent to two parallel processing streams (archive to S3, and parse contents). Thanks to Gary Russel I've used the publish-subscribe channel's apply-sequence="true"
behaviour on the original File message. When both streams have finished with a file they should put the File message with the original correlation headers onto a 'processed' channel, from where an Aggregator groups them, and when both have been aggregated puts them on a channel that feeds a service activator that deletes the files.
So, in summary, I want a service activator to put its output on one channel, and at the same time put the original message it received on to another channel.
UPDATE
Would I be better off using publish-subscribe
synchronously with the subscribers being executed serially in the order specified by the order
attribute?