Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-720

AggregationStrategy fails when completionSize is used as an expression (rather than value)

    XMLWordPrintable

Details

    Description

      If a camel route contains a aggregation strategy like below using a expression for completionSize as opposed to the value, it fails on the last line and waits for the next file to aggregate the last line of the file into new message.

      from(getFileComponentString())
              .split(body(String.class).tokenize("\n"))
                  .aggregate(constant(true), new MyAggregationStrategy())
      //            .completionSize(2)
                  .completionSize(constant(2))
                  .completionTimeout(1000L)
                  .to(destination)
              .end();
      

      In this case if the file contains 5 lines 3 aggregate messages are created if ".completionSize(2)" is used and if " .completionSize(constant(2))" is used only 2 messages are created and the last line is kept pending on receipt of another line from next file to create new aggregate message.

      Attachments

        Activity

          People

            cibsen@redhat.com Claus Ibsen
            ubhole Ulhas Bhole (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: