Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB3DD1745F for ; Mon, 27 Apr 2015 15:01:12 +0000 (UTC) Received: (qmail 62440 invoked by uid 500); 27 Apr 2015 15:01:12 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 62401 invoked by uid 500); 27 Apr 2015 15:01:12 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 62121 invoked by uid 99); 27 Apr 2015 15:01:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 15:01:06 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: message received from 54.76.25.247 which is an MX secondary for users@camel.apache.org) Received: from [54.76.25.247] (HELO mx1-eu-west.apache.org) (54.76.25.247) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 15:00:42 +0000 Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 2493920522 for ; Mon, 27 Apr 2015 15:00:41 +0000 (UTC) Received: by igblo3 with SMTP id lo3so63283927igb.0 for ; Mon, 27 Apr 2015 07:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=RvQV4Vjug+Kc1eHbJYirF3lZ7nemQp30wnawtrltiVE=; b=cNRL/xNt+BDC3nsfC/VE0gVaA1BfaXxeC5IZpYVuHzZa7XZehTWTJUT9aJVtkyBKP0 cVGc+H5xrHTViRv4P6xtcD6tcQqjD6jcojXpn891q+tG+8UKOjNKSbJwRPTc8dwQJ7A/ dgD5t/ZuiRLdBv02/xMW7TvMfkqu67Jn8rfWXSc3HDhBkra7nE6Qpy1lEWJ0DZBRvkre 3eEQnBabsLO7sjqanb1F5Saq1O6cUjDMRS/CqzKsSCqn+TtviwTuihswcxDAOHRtSguG QvBMLzOVZ6lZMNmH1qROTcWEpN2mHlTBeghdboJjNQrKUy8XTy8bE7avj9gQle4AxmXv TV4Q== X-Received: by 10.50.50.209 with SMTP id e17mr13767520igo.37.1430146788999; Mon, 27 Apr 2015 07:59:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.90.199 with HTTP; Mon, 27 Apr 2015 07:59:28 -0700 (PDT) In-Reply-To: <1430145974579-5766386.post@n5.nabble.com> References: <1430145974579-5766386.post@n5.nabble.com> From: Claus Ibsen Date: Mon, 27 Apr 2015 16:59:28 +0200 Message-ID: Subject: Re: How to guarantee OnCompletion() is called before a file is routed further down the route To: "users@camel.apache.org" Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org 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 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: cibsen@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/