Since an aggregator may get messages from different channels it would be great to have a comparator for sorting the incoming messages.
Cheers Tai
Since an aggregator may get messages from different channels it would be great to have a comparator for sorting the incoming messages.
Cheers Tai
Of course I mean a SequenceNumberComparator![]()
There is a <resequencer/> as well, and its role is very similar to Aggregator except that it does not combine the incoming Messages into a single Message. It does, however, re-order the Messages according to the sequenceNumber value. Have you tried using that?
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Great! I will try that.
Thanks Tai
And how do I configure the resequencer? It seems I cannot add that to an aggregator.
I tried this:
<resequencer input-channel="requestChannel"/>
But that seems not to work.
Tai,
The <resequencer/> does not get added to an <aggregator/>, you would have to use it instead of the <aggregator/> (with the same input/output channels that you intended to use there).
Regards,
Marius
Marius Bogoevici,
Spring Integration Committer
Ok. Let me be more precise. I already thought that I have to use a resequencer first and then an aggregator. Like this:
But as I can already see in eclipse it is complaining that: "Attribute 'input-channel' is not allowed to appear in element resequencer".Code:<resequencer id="csvResequencer" input-channel="rowChannel" output-channel="resequencerChannel"/> <aggregator id="csvToAdaptersTranslatorServiceActivator" input-channel="resequencerChannel" output-channel="adapterChannel" ref="csvToAdaptersTranslator" method="translate"> </aggregator>
Trying to read the configuration of course I get the following:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'input-channel' is not allowed to appear in element 'resequencer'.
at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(U nknown Source)
This issue has been resolved on the SVN head. I added an issue so that others who encounter this will be able to find it in JIRA: http://jira.springframework.org/browse/INT-406
If you are unable to upgrade to the head version, know that we are aiming for RC1 at the end of next week. I believe in the meantime you can add a resequencer element's id as a "ref" value within a <service-activator/>. That is admittedly clunky, but here's what the (more consistent) head version of "resequencerParserTests.xml" looks like:
Code:<resequencer id="completelyDefinedResequencer" input-channel="inputChannel2" output-channel="outputChannel" discard-channel="discardChannel" send-timeout="86420000" send-partial-result-on-timeout="true" reaper-interval="135" tracked-correlation-id-capacity="99" timeout="42" release-partial-sequences="false"/>
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf