Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 55840 invoked from network); 29 Oct 2010 14:47:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Oct 2010 14:47:36 -0000 Received: (qmail 2441 invoked by uid 500); 29 Oct 2010 14:47:36 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 2260 invoked by uid 500); 29 Oct 2010 14:47:35 -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 2251 invoked by uid 99); 29 Oct 2010 14:47:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Oct 2010 14:47:34 +0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=SPF_HELO_PASS,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of olivier.roger@bsb.com does not designate 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Oct 2010 14:47:28 +0000 Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1PBqEV-0007qi-C3 for users@camel.apache.org; Fri, 29 Oct 2010 07:47:07 -0700 Date: Fri, 29 Oct 2010 07:47:07 -0700 (PDT) From: "Olivier.Roger" To: users@camel.apache.org Message-ID: <1288363627368-3242130.post@n5.nabble.com> Subject: Throttler in a Choice ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello Camel, I am using Camel 2.4 and writting my first Java DSL route I would like to translate the following route from Spring DSL: ${header.JMSPriority} < 5 Here is what I did : @Override public void configure() throws Exception { from("direct:throttler.in") .choice() .when(simple("header.JMSPriority >= 5")) .throttle(50).timePeriodMillis(60000) .to("direct:nsResolved") //.end() .otherwise() .to("direct:nsResolved") .end(); } In both case I can use otherwise() because I dont have a ChoiceDefinition object. Like that I get a ThrottlerDefinition, which implements block, so I should close is with end() I suppose. In that case I get a ProcessDefinition not a ChoiceDefinition. Am I doing something wrong here ? Thanks for your help, Olivier -- View this message in context: http://camel.465427.n5.nabble.com/Throttler-in-a-Choice-tp3242130p3242130.html Sent from the Camel - Users mailing list archive at Nabble.com.