Camel
  1. Camel
  2. CAMEL-3189

Completed aggregated exchanges are never confirmed in the AggregationRepository

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Under certain circumstances, the completed exchanges from an aggregator would remain in the AggregationRepository and redeliver after a restart of Camel. These exchanges had already successfully completed their route, so this redelivery is in error.

      My guess is that in the AggregationProcessor on line 374, the AggregateOnCompletion gets added to a UnitOfWork that doesn't ever get done() called on it... or something.

      I seemed to be able to prevent the problem by changing my AggregationStrategy. The old version looked like this:

      public Exchange aggregate (Exchange oldExchange, Exchange newExchange) {
        String body = "";
        if (oldExchange != null) {
          body = oldExchange.getIn().getBody(String.class);
        }
        body += newExchange.getIn().getBody(String.class);
       newExchange.getIn().setBody(body);
       return newExchange;
      }
      

      You can see that the exchanges are aggregated into the newExchange. I changed it to aggregate into the oldExchange:

      public Exchange aggregate (Exchange oldExchange, Exchange newExchange) {
        String body = "";
        if (oldExchange != null) {
          body = oldExchange.getIn().getBody(String.class);
        } else {
          oldExchange = newExchange;
        }
      
        body += newExchange.getIn().getBody(String.class);
        oldExchange.getIn().setBody(body);
       return oldExchange;
      }
      

        Activity

        Glenn Moss created issue -
        Hide
        Claus Ibsen added a comment -

        You could paste details about the route you use as well?

        Show
        Claus Ibsen added a comment - You could paste details about the route you use as well?
        Claus Ibsen made changes -
        Field Original Value New Value
        Assignee Claus Ibsen [ davsclaus ]
        Hide
        Claus Ibsen added a comment -

        trunk: 1003751.

        It works fine in 2.5. I actually would assume it works fine in 2.4 as well as we improve the aggregator in that version.
        You should upgrade to Camel 2.4 and try with that version.

        Show
        Claus Ibsen added a comment - trunk: 1003751. It works fine in 2.5. I actually would assume it works fine in 2.4 as well as we improve the aggregator in that version. You should upgrade to Camel 2.4 and try with that version.
        Claus Ibsen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.5.0 [ 12320 ]
        Resolution Fixed [ 1 ]
        Jeff Turner made changes -
        Project Import Sat Nov 27 00:14:50 EST 2010 [ 1290834890113 ]
        Hide
        Claus Ibsen added a comment -

        Closing all resolved tickets from 2010 or older

        Show
        Claus Ibsen added a comment - Closing all resolved tickets from 2010 or older
        Claus Ibsen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        8h 20m 1 Claus Ibsen 02/Oct/10 08:58
        Resolved Resolved Closed Closed
        204d 1h 59m 1 Claus Ibsen 24/Apr/11 10:58

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Glenn Moss
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development