Announcement Announcement Module
Collapse
No announcement yet.
SequenceSizeComparator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SequenceSizeComparator

    Since an aggregator may get messages from different channels it would be great to have a comparator for sorting the incoming messages.

    Cheers Tai

  • #2
    Correction: number not size

    Of course I mean a SequenceNumberComparator

    Comment


    • #3
      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?

      Comment


      • #4
        Great! I will try that.

        Thanks Tai

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment


            • #7
              Originally posted by mbogoevici View Post
              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).
              To be a bit more precise you would use a resequencer AND an aggregator as two separate endpoints. The resequencer passes messages in sequence, where the aggregator combines multiple messages into one.

              Comment


              • #8
                Ok. Let me be more precise. I already thought that I have to use a resequencer first and then an aggregator. Like this:

                Code:
                	<resequencer id="csvResequencer" input-channel="rowChannel" output-channel="resequencerChannel"/>
                
                	<aggregator id="csvToAdaptersTranslatorServiceActivator" input-channel="resequencerChannel" output-channel="adapterChannel"
                		ref="csvToAdaptersTranslator" method="translate">
                	</aggregator>
                But as I can already see in eclipse it is complaining that: "Attribute 'input-channel' is not allowed to appear in element resequencer".

                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)

                Comment


                • #9
                  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"/>

                  Comment

                  Working...
                  X