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 9BB751079D for ; Wed, 26 Mar 2014 06:27:59 +0000 (UTC) Received: (qmail 68502 invoked by uid 500); 26 Mar 2014 06:27:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 68467 invoked by uid 500); 26 Mar 2014 06:27:58 -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 Delivered-To: moderator for users@camel.apache.org Received: (qmail 26070 invoked by uid 99); 25 Mar 2014 20:45:30 -0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=HTML_MESSAGE,URI_HEX X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of tobeda21@uwgb.edu) Date: Tue, 25 Mar 2014 13:45:04 -0700 (PDT) From: doug5791 To: users@camel.apache.org Message-ID: In-Reply-To: <1395774868270-5749356.post@n5.nabble.com> References: <1395767534886-5749351.post@n5.nabble.com> <1395774868270-5749356.post@n5.nabble.com> Subject: Re: Camel: How to stop a route temporarily? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_605608_31391045.1395780304877" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_605608_31391045.1395780304877 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I guess the biggest thing I need to accomplish is telling all the exchanges that are stopped to go to the next endpoint. Is there something I can append like a property that says: "exchange.set property(Exchange.goToEndpoint, "database")"? "doug5791 [via Camel]" wrote: I am currently trying to use the "Exchange.ROUTE_STOP" property -I do not think that using a CountDownLatch will work out-, however I do not get the desired effect. Using the code below, only the last Exchange goes on to the database: //exAr is a List of Exchanges .process(new Processor() { public void process(Exchange exchange) throws Exception { //Check if cache is not full, add the exchange, set exchange to stop if(exAr.size() < CACHEMAXSIZE) { exAr.add(exchange); cacheSize++; exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE); } //Check if cache is full, iterate exchanges and set to go, clear cache if(exAr.size() == CACHEMAXSIZE) { for(int i = 0; i < CACHEMAXSIZE; i++) { exAr.get(i).setProperty(Exchange.ROUTE_STOP, Boolean.FALSE); } cacheSize = 0; exAr.clear(); } } }) .to("database") According to the documentation on using ROUTE_STOP this should be what I'm looking for. However only the last item in the List is sent on to the database. ________________________________ If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/Camel-How-to-stop-a-route-temporarily-tp5749351p5749356.html To unsubscribe from Camel: How to stop a route temporarily?, click here. NAML -- View this message in context: http://camel.465427.n5.nabble.com/Camel-How-to-stop-a-route-temporarily-tp5749351p5749360.html Sent from the Camel - Users mailing list archive at Nabble.com. ------=_Part_605608_31391045.1395780304877--