You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Glenn Moss (JIRA)" <ji...@apache.org> on 2010/10/02 01:39:40 UTC

[jira] Created: (CAMEL-3189) Completed aggregated exchanges are never confirmed in the AggregationRepository

Completed aggregated exchanges are never confirmed in the AggregationRepository
-------------------------------------------------------------------------------

                 Key: CAMEL-3189
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3189
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 2.3.0
            Reporter: Glenn Moss


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:
{code}
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;
}
{code}

You can see that the exchanges are aggregated into the newExchange. I changed it to aggregate into the oldExchange:
{code}
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;
}
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-3189) Completed aggregated exchanges are never confirmed in the AggregationRepository

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-3189:
----------------------------------

    Assignee: Claus Ibsen

> Completed aggregated exchanges are never confirmed in the AggregationRepository
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-3189
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3189
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Glenn Moss
>            Assignee: Claus Ibsen
>
> 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:
> {code}
> 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;
> }
> {code}
> You can see that the exchanges are aggregated into the newExchange. I changed it to aggregate into the oldExchange:
> {code}
> 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;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3189) Completed aggregated exchanges are never confirmed in the AggregationRepository

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62277#action_62277 ] 

Claus Ibsen commented on CAMEL-3189:
------------------------------------

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

> Completed aggregated exchanges are never confirmed in the AggregationRepository
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-3189
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3189
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Glenn Moss
>
> 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:
> {code}
> 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;
> }
> {code}
> You can see that the exchanges are aggregated into the newExchange. I changed it to aggregate into the oldExchange:
> {code}
> 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;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-3189) Completed aggregated exchanges are never confirmed in the AggregationRepository

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3189.
--------------------------------

    Fix Version/s: 2.5.0
       Resolution: Fixed

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.

> Completed aggregated exchanges are never confirmed in the AggregationRepository
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-3189
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3189
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Glenn Moss
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>
> 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:
> {code}
> 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;
> }
> {code}
> You can see that the exchanges are aggregated into the newExchange. I changed it to aggregate into the oldExchange:
> {code}
> 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;
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.