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 552C8117DD for ; Tue, 20 May 2014 10:02:28 +0000 (UTC) Received: (qmail 42974 invoked by uid 500); 20 May 2014 10:02:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 42927 invoked by uid 500); 20 May 2014 10:02:28 -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 42919 invoked by uid 99); 20 May 2014 10:02:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2014 10:02:28 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ch007m@gmail.com designates 209.85.216.182 as permitted sender) Received: from [209.85.216.182] (HELO mail-qc0-f182.google.com) (209.85.216.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2014 10:02:24 +0000 Received: by mail-qc0-f182.google.com with SMTP id e16so314967qcx.13 for ; Tue, 20 May 2014 03:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=FCF8RuD+f7k4R3wNYDQ51+yf9uTeybqfotf7Pkj0RKo=; b=q6lJm6L+4tmErtRBkTMhFAzThE+rejjHX9/+IGIjccAHyrR+Ok8ZL24TwfN1HbzuuO NuErgQfDfLOTsMlapDkbN/mpvmlYCptxkkDZyo1JZCb2p+ZKsTERCvFFURByvBOgwcGO xBeBeIm/yAUt+mxXqWxOj63GsSuJHDD8299Nt3D0Ft0TWKCv7rMlk+8NWMbqJQjr0cD5 L8KBgPmRmf6ub1+O4Zmh8TbDiTCNTdQ7irddOvcPVkoxMa1acS8MOcK7TJmm6YXu/8OB /JE6rnlGENsmoF34oQLmpGMj665pGJZ7l0JsbqOQws24QByN4WaH8rE7UVeaw/UzUf3J 6vAg== MIME-Version: 1.0 X-Received: by 10.224.97.69 with SMTP id k5mr56406493qan.8.1400580121048; Tue, 20 May 2014 03:02:01 -0700 (PDT) Received: by 10.224.219.201 with HTTP; Tue, 20 May 2014 03:02:00 -0700 (PDT) In-Reply-To: <1400565787883-5751323.post@n5.nabble.com> References: <1400512451407-5751292.post@n5.nabble.com> <1400565787883-5751323.post@n5.nabble.com> Date: Tue, 20 May 2014 12:02:00 +0200 Message-ID: Subject: Re: CSV bindy From: Charles Moulliard To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001a1133d4e6983c6104f9d1f88e X-Virus-Checked: Checked by ClamAV on apache.org --001a1133d4e6983c6104f9d1f88e Content-Type: text/plain; charset=UTF-8 Your project works very well Camel Route : Model import org.apache.camel.dataformat.bindy.annotation.CsvRecord; import org.apache.camel.dataformat.bindy.annotation.DataField; import java.math.BigDecimal; @CsvRecord(separator = ",", skipFirstLine = false) public class Model { @DataField(pos = 1) private String str1; @DataField(pos = 2) private String str2; @DataField(pos = 3) private String str3; @DataField(pos = 4, precision = 2) private BigDecimal amount; } Result : [pache.camel.spring.Main.main()] SpringCamelContext INFO Apache Camel 2.13.1 (CamelContext: camel-1) started in 0.269 seconds [1) thread #0 - file://src/data] route1 INFO Begin myRoute from file : some_string,some_other_string,other_one,121657.56 [1) thread #0 - file://src/data] route1 INFO CSV record marshalled [1) thread #0 - file://src/data] route1 INFO >> Record : some_string,some_other_string,other_one,121657.56 On Tue, May 20, 2014 at 8:03 AM, sergarci wrote: > Yes here is an example: > > *The file looks like:* > > some_string,some_other_string,other_one,121657.56 > > *the java class that maps the csv file:* > > @CsvRecord(separator = ",", skipFirstLine = true) > public class MyClass { > @DataField(pos = 1) > private String str1; > @DataField(pos = 2) > private String str2; > @DataField(pos = 3) > private String str3; > @DataField(pos = 4, precision = 2) > private BigDecimal amount; > /*getters and setters*/ > } > > *And the spring route is like:* > > > uri="file:///Inbox?noop=true&fileName=someCSV&consumer.delay=10000" > /> > > > > > ... > > > Thanks! > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/CSV-bindy-tp5751292p5751323.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io --001a1133d4e6983c6104f9d1f88e--