You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by breilhes <br...@voila.fr> on 2013/01/11 11:34:52 UTC

Bug with completionSize on AggregatorProcessor

Hi,

related topic :
http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-td5721307.html

I've tested the bug correction (CAMEL-5720) on version 2.10.3 and there is a
regression. If completionSizeExpression is activated and not completed, you
return null and the completionTimeout is never tested.

You should replace code with above lines in method
protected String isCompleted(String key, Exchange exchange) 


boolean completionSizeExpressionChecked = false;
if (getCompletionSizeExpression() != null) {
     Integer value = getCompletionSizeExpression().evaluate(exchange,
Integer.class);
     if (value != null && value > 0) {
         completionSizeExpressionChecked  = true;
         int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
Integer.class);
         if (size >= value) {
              return "size";
         }
      }
 }

if (!completionSizeExpressionChecked  && getCompletionSize() > 0) {
     int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
Integer.class);
     if (size >= getCompletionSize()) {
         return "size";
     }
}

Regards,




--
View this message in context: http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-tp5725364.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Bug with completionSize on AggregatorProcessor

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for reporting.

Do you mind creating a JIRA ticket with this bug report?

There is a link here, and also some notes about the procedure
http://camel.apache.org/support

And if you want, you are welcome to work on a patch, and if its
possible to have an unit test as well.
That would be top dollar.

Though if not, then your description should suffice to look into the bug.




On Fri, Jan 11, 2013 at 11:34 AM, breilhes <br...@voila.fr> wrote:
> Hi,
>
> related topic :
> http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-td5721307.html
>
> I've tested the bug correction (CAMEL-5720) on version 2.10.3 and there is a
> regression. If completionSizeExpression is activated and not completed, you
> return null and the completionTimeout is never tested.
>
> You should replace code with above lines in method
> protected String isCompleted(String key, Exchange exchange)
>
>
> boolean completionSizeExpressionChecked = false;
> if (getCompletionSizeExpression() != null) {
>      Integer value = getCompletionSizeExpression().evaluate(exchange,
> Integer.class);
>      if (value != null && value > 0) {
>          completionSizeExpressionChecked  = true;
>          int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
> Integer.class);
>          if (size >= value) {
>               return "size";
>          }
>       }
>  }
>
> if (!completionSizeExpressionChecked  && getCompletionSize() > 0) {
>      int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1,
> Integer.class);
>      if (size >= getCompletionSize()) {
>          return "size";
>      }
> }
>
> Regards,
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-tp5725364.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen