Announcement Announcement Module
Collapse
No announcement yet.
aggregator w/ correlation-strategy-expression only working once Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • aggregator w/ correlation-strategy-expression only working once

    My use case is that I would like to aggregate a batch of messages w/ no correlation strategy before sending it to another channel. Unfortunately, a correlation strategy is required, so I tried the following workaround but it only works for the first batch:

    <int:aggregator id = "myAggregator"
    input-channel = "inputChannel"
    output-channel = "outputChannel"
    send-partial-result-on-expiry = "true"
    send-timeout = "1000"
    correlation-strategy-expression = "1"
    release-strategy-expression = "size() gt 20"
    />

    Any idea why this only works once?

    Thanks in advance,

    Steve

  • #2
    Look at this sample: https://github.com/olegz/s12gx.2011/...ion/aggregator
    It talks about exactly the same issue. You can also see the youtube version which touches in this and other use cases http://www.youtube.com/watch?v=RY6dN...5&feature=plcp
    Basically you need to set "expire-groups-upon-completion" attribute to false
    Code:
    expire-groups-upon-completion="false"

    Comment


    • #3
      Oleg,

      Thanks for the quick reply.

      I didn't see that attribute in the reference manual; however, it looks like it's false by default. I tried setting it explicitly to false but I still have the same problem.

      I failed to mention it, but I'm using spring-integration-2.2.0.M2.

      Steve

      Comment


      • #4
        If you go through that demo you'll see that you ned to set it to true. Just go through the read me and/or the screencast

        Comment


        • #5
          Oleg,

          Sorry, I guess I misunderstood the attribute.

          Setting expire-groups-upon-completion="true" worked!

          Thanks for your help.

          Steve

          Comment


          • #6
            Hello

            Let me explain it shortly too:
            Result of CorrelationStrategy is presented as MessageGroupId. So, your ReleaseStrategy marks that group as compleat and doesn't aggregate it again in the default case - expire-groups-upon-completion="false"

            Cheers,
            Artem Bilan

            Comment


            • #7
              Artem,

              Thanks for the explanation. It was very helpful.

              Hopefully, it will be documented as well in the reference manual soon. ;-)

              Steve

              Comment

              Working...
              X