For those who recognise it, I've copied this question I posted on StackOverflow, in the hope I get some more feedback or suggestions...
In my Spring Integration powered project I have a splitter and router combination for sending my source object to various transformers. The new "transformed" objects are then passed back to an aggregator and processed. This all works very well, except that my aggregator had to pass my results as a single ArrayList payload back to the flow so they could be passed to the outbound-channel-adapter (which then had to accept an ArrayList payload).
This is an example of how my flow used to look like:
Now, I want to split up my aggregated results so they are processed properly, since I need to route some of the objects to a different outbount-channel-adapter. I added a new DefaultMessageSplitter after the aggregator, but it seems only the first element gets passed to the router.Code:<splitter ref="articleContentExtractor" /> <payload-type-router> ... routing to various transformers ... ... results are sent to articleOutAggregateChannel ... </payload-type-router> <aggregator ref="articleAggregator" input-channel="articleOutAggregateChannel" /> <outbound-channel-adapter id="contentSaveService" ref="contentExporter" method="persist" channel="contentOutChannel" />
This is my current, broken, flow:
What am I doing wrong? Am I using my aggregator properly?Code:<splitter ref="articleContentExtractor" /> <payload-type-router> ... routing to various transformers ... ... results are sent to articleOutAggregateChannel ... </payload-type-router> <aggregator ref="articleAggregator" input-channel="articleOutAggregateChannel" /> <splitter ref="entitySaveRouter" /> <payload-type-router resolution-required="true"> <mapping type="x.y.z.AbstractContent" channel="contentOutChannel" /> <mapping type="x.y.z.Staff" channel="staffOutChannel" /> </payload-type-router> <outbound-channel-adapter id="contentSaveService" ref="contentExporter" method="persist" channel="contentOutChannel" /> <outbound-channel-adapter id="staffSaveService" ref="staffExporter" method="persist" channel="staffOutChannel" />
Note: If I just remove the aggregator (and the second splitter) altogether the rest of the flow works perfectly, although the aggregator is required to perform some cross-referencing actions.


Reply With Quote
