camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: How to guarantee OnCompletion() is called before a file is routed further down the route
Date Mon, 27 Apr 2015 14:59:28 GMT
on completion is only for when the exchange is done being routed
totally. Not in between eips in routes.

You can add your task as a bean / processor step between the 2 eips.
Or look at interceptors and then only do your work after the middle
etc, but that takes a little bit of code to filter when to do the

And there is also the event notifier you can look at.

On Mon, Apr 27, 2015 at 4:46 PM, Tom1738 <> wrote:
> Hi
> I am considering a new camel route implemented in java, something like,
>         from(file://input).to(file:/middle).to(file:output).
> I want to introduce a Synchronization.onComplete() operation after
> "to(file://middle)" doing some housekeeping, such as checking the file has
> been routed from "/input" to "/middle" and what size it is.
> However, I can't guarantee that the onComplete() callback will be invoked
> BEFORE the file is routed from "/middle" to "/output". If that happens, the
> housekeeping checks will fail its purpose (as the file is already moved to
> "/output").
> Can anyone out there let me know if there is some Apache Camel mechanism
> that can guarantee the order of OnCompletion() coming before the file is
> routed further down? If that's not available in Camel, any suggestions how I
> can achieve the goal?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message