Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 41347 invoked from network); 19 Apr 2010 09:13:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Apr 2010 09:13:41 -0000 Received: (qmail 71382 invoked by uid 500); 19 Apr 2010 09:13:41 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 71208 invoked by uid 500); 19 Apr 2010 09:13:40 -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 71200 invoked by uid 99); 19 Apr 2010 09:13:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Apr 2010 09:13:39 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.218.214 as permitted sender) Received: from [209.85.218.214] (HELO mail-bw0-f214.google.com) (209.85.218.214) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Apr 2010 09:13:34 +0000 Received: by bwz6 with SMTP id 6so4475326bwz.33 for ; Mon, 19 Apr 2010 02:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type :content-transfer-encoding; bh=IeOyCn2edvHGdhkOBtqVoYLSNj0x3IWfEfSzasAMJCQ=; b=DQ79yPgOBqPzodpPZ2v2TdlWVKhMAb+pcCFdJTHG7Sw05GbL/Ox3Yz6FL9XGXrSjki tw4NOPpx4c8e6qgfQtmVM8f3kMbf4U2KOlaF9d0q4ehJ0DfilzIICYlv39Ff1eVL15uZ C6UhILQ+J9eihLleRj2Qo+Via8C6GIkj4TdFc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=jeDmBq6ijzFNZoBI11FpwpKrz9MaUgJSlNrJ6RAI6UCVi45gkHM+PhvOXyBjo7tvU6 hlsgku3rHQySkCg6/htZEz+3ILRtyT2VHdikd2nx1veuLWSScG5oHEZBmUpG5rs1KHcq eAx8n6AB4P1+iLXSfIetitgZsEhRaxHa7v7qg= MIME-Version: 1.0 Received: by 10.204.115.210 with HTTP; Mon, 19 Apr 2010 02:12:53 -0700 (PDT) In-Reply-To: <28287615.post@talk.nabble.com> References: <28284152.post@talk.nabble.com> <28287615.post@talk.nabble.com> From: Claus Ibsen Date: Mon, 19 Apr 2010 11:12:53 +0200 Received: by 10.204.13.68 with SMTP id b4mr4296191bka.133.1271668393355; Mon, 19 Apr 2010 02:13:13 -0700 (PDT) Message-ID: Subject: Re: Split Body in Spring DSL To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Yeah I can see the problem now. The language was originally designed for creating dynamic Strings, and hence ${body} is parsed as "" + body, which cause Camel to type coerce the body to a String type as well. I will look into this. On Mon, Apr 19, 2010 at 9:28 AM, Olivier Roger wrot= e: > > Hello Claus, > > I was using the tokenize on "]," but some brackets from the toString > representation where still present in the result, which is normal. > > Using ${body} seems indeed to be what I was looking for. > However, at the moment when I used it, the splitter return 1 message per > cell instead of per row. > > So a 5 line, with 5 line per row, document is split into 25 messages. > > Is there a way to force change this behavior ? > > Thanks, > > Olivier > > > Claus Ibsen-2 wrote: >> >> Hi >> >> Yeah the split EIP pattern will be explained in chapter 8 in both Java >> and Spring XML examples. >> >> You can also see a bit more here >> http://camel.apache.org/splitter.html >> >> You use the and it requires a token, such as \n or comma etc= . >> >> >> To do the exact same example as in Java DSL you can do >> ${body} >> >> To let Camel "figure out" based on the Body and split it. Since the >> Body is most likely a List or the likes, then Camel >> will iterate the list in the splitting. >> >> >> >> On Sun, Apr 18, 2010 at 8:28 PM, Olivier Roger >> wrote: >>> >>> Hello Camel! >>> >>> I am currently reading the "Camel in Action" book, where I found an >>> example >>> to unmarshal a csv file. >>> >>> The example is in Java DSL and I can't found the similar Spring DSL >>> expression to .split(body()) >>> >>> The full Java example is >>> >>> .from("...").unmarchal().csv().split(body()).to("..."); >>> >>> Here is my Spring DSL route >>> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> >>> Thanks in advance for your help ! >>> >>> Olivier >>> -- >>> View this message in context: >>> http://old.nabble.com/Split-Body-in-Spring-DSL-tp28284152p28284152.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Author of Camel in Action: http://www.manning.com/ibsen/ >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- > View this message in context: http://old.nabble.com/Split-Body-in-Spring-= DSL-tp28284152p28287615.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus