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 53B79E5EE for ; Mon, 4 Feb 2013 17:25:21 +0000 (UTC) Received: (qmail 44973 invoked by uid 500); 4 Feb 2013 17:25:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 44940 invoked by uid 500); 4 Feb 2013 17:25:20 -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 44928 invoked by uid 99); 4 Feb 2013 17:25:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 17:25:20 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.214.177 as permitted sender) Received: from [209.85.214.177] (HELO mail-ob0-f177.google.com) (209.85.214.177) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 17:25:16 +0000 Received: by mail-ob0-f177.google.com with SMTP id wc18so6468875obb.8 for ; Mon, 04 Feb 2013 09:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=O3FrSKmOQe0va+KtKphnkyfqObnrmrqq5niGOFk695c=; b=0YiMJWH49DQ6WsaIfvoQ1j/LBdd+6HMMhYpQYG2XpLwAtnRu3bF9oQt3GnNOGFHvQU D8u48qD3R642y0JPqXug3EneE1INK4UQyUX6+Z3mkkfaxKv8z9vsNTCuUkxYJV170aGL hJRNlebU+Us1mIXKHHpyh1UK1o4cGCzWnmANZNUtg2v7uhPJKwitgoTTQc9aZZ99zOkj ZWlAtFwlrFL1tVV5tP2Mzw6oEi/eriTtMaRaexASAHKYcPgWaemK2dZ6GF5Ba9t+SlIb Pp2FKlrOZyMrVlgwbjBe+Hl/vfYLIqucvBj2yw+AEK9fvO3LefHo4/6TMSfJYfDSlLFZ rkug== X-Received: by 10.182.38.66 with SMTP id e2mr15905391obk.83.1359998694818; Mon, 04 Feb 2013 09:24:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.172.228 with HTTP; Mon, 4 Feb 2013 09:24:34 -0800 (PST) In-Reply-To: <1359992119961-5726909.post@n5.nabble.com> References: <1359986094310-5726900.post@n5.nabble.com> <1359988207379-5726904.post@n5.nabble.com> <1359992119961-5726909.post@n5.nabble.com> From: Claus Ibsen Date: Mon, 4 Feb 2013 18:24:34 +0100 Message-ID: Subject: Re: Splitter with option To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Feb 4, 2013 at 4:35 PM, kikou1984 wrote: > I tried this one : > > > .split() > .method(myClass, "methodTosplit") > .choice().when().simple("${property.CamelSplitIndex} == 2") > .bean(myClassA, "methodA") > .otherwise() > .bean(myClassB, "methodB"); > > > it works. > > if you got a better idea let me know thxs. > For each split, the body change by creating a new one, but not the header. > > how can i do to reload the header for each split ? > > Then i can put : for the fist split headers.put("Array",fistOne") and for > the second headers.put("Array",secondOne"). > > And in the main prog, i can make test, > > .choice().when().simple("${in.header.Array} == fistOne").bean(myClassA, > "methodA") > .otherwise() > .bean(myClassB, "methodB"); > Your splitter bean can return a org.apache.camel.Message. And there you can add the body, and also add headers such as if you want to call bean A or bean B afterwards. An alternative is to have another bean, that figures out to call bean A or bean B. .split() .method(myClass, "methodTosplit") .bean(myClass, "callAorB") > > thxs. > > > > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Splitter-with-option-tp5726900p5726909.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen