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
work.

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

On Mon, Apr 27, 2015 at 4:46 PM, Tom1738 <tong....@uk.fujitsu.com> 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: 
> http://camel.465427.n5.nabble.com/How-to-guarantee-OnCompletion-is-called-before-a-file-is-routed-further-down-the-route-tp5766386.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to