You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sakouhi <sa...@gmail.com> on 2017/06/08 09:29:22 UTC

Parsing csv data format

I followed an example from a book Camel in action. how to marchal and
unmarchal a csv data format. However, I want to unmarchal a csv files with
(comma seperated delimiter) and split body. Then, I will use content based
.choice to distribute messages according to required tasks. 
In fact, The first and simple example didn't  work to me. I used camel
2.15.6 (camel-core, camel-context, camel-csv, commons-csv) and  java 7. 
public void configure()
             {
        	  CsvDataFormat csv = new CsvDataFormat();
        	  csv.setDelimiter(",");
        	   
        	  from("file:test?noop=true")
        	 .unmarshal().csv()
        	  .split(body())
        	  .to("file:out");
             } 
Please find below the stack trace.  
<http://camel.465427.n5.nabble.com/file/n5802566/errorstack.png> 



--
View this message in context: http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Parsing csv data format

Posted by Giorgio Vespucci <gi...@gmail.com>.
Sakouhi,
It looks like your code is running on JRE 1.8.0.
Have you tried to run it on Java 7?
Just because you mentioned this version issue...
I don't know if Camel 2.15 can run on Java 8...

On Thu, Jun 8, 2017 at 5:15 PM sakouhi <sa...@gmail.com> wrote:

> Ok Thanks Allan,
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566p5802575.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Parsing csv data format

Posted by sakouhi <sa...@gmail.com>.
Ok Thanks Allan,



--
View this message in context: http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566p5802575.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Parsing csv data format

Posted by "Allan C." <al...@gmail.com>.
The image you attached looks similar with the usual start up logs info, and
is not describing any error. It would be easier to troubleshoot if there's
an error log.

Nonetheless the camel lock file is created when the file is being processed
by your route. Claus would be the SME to help.


Regards, Allan.

Sent from Gmail mobile.

On 8 Jun 2017 18:32, "sakouhi" <sa...@gmail.com> wrote:

> Yes, the program locks the file (for example test\standard.csv.camelLock ),
> then it shut down.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Parsing-csv-data-format-tp5802566p5802568.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Parsing csv data format

Posted by sakouhi <sa...@gmail.com>.
Yes, the program locks the file (for example test\standard.csv.camelLock ),
then it shut down.



--
View this message in context: http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566p5802568.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Parsing csv data format

Posted by "Allan C." <al...@gmail.com>.
Can you confirm the attached image is a stack trace?

Regards, Allan.

Sent from Gmail mobile.

On 8 Jun 2017 17:48, "sakouhi" <sa...@gmail.com> wrote:

> I followed an example from a book Camel in action. how to marchal and
> unmarchal a csv data format. However, I want to unmarchal a csv files with
> (comma seperated delimiter) and split body. Then, I will use content based
> .choice to distribute messages according to required tasks.
> In fact, The first and simple example didn't  work to me. I used camel
> 2.15.6 (camel-core, camel-context, camel-csv, commons-csv) and  java 7.
> public void configure()
>              {
>                   CsvDataFormat csv = new CsvDataFormat();
>                   csv.setDelimiter(",");
>
>                   from("file:test?noop=true")
>                  .unmarshal().csv()
>                   .split(body())
>                   .to("file:out");
>              }
> Please find below the stack trace.
> <http://camel.465427.n5.nabble.com/file/n5802566/errorstack.png>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Parsing-csv-data-format-tp5802566.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Parsing csv data format

Posted by sakouhi <sa...@gmail.com>.
The newest version of Camel requires Java 8. In my work, we use java 7.
I followed the example into the book Camel in action which use camel version
2.5.0 



--
View this message in context: http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566p5802572.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Parsing csv data format

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Is there a reason you use such an old Camel version 2.15?
The latest is 2.19

On Thu, Jun 8, 2017 at 11:29 AM, sakouhi <sa...@gmail.com> wrote:
> I followed an example from a book Camel in action. how to marchal and
> unmarchal a csv data format. However, I want to unmarchal a csv files with
> (comma seperated delimiter) and split body. Then, I will use content based
> .choice to distribute messages according to required tasks.
> In fact, The first and simple example didn't  work to me. I used camel
> 2.15.6 (camel-core, camel-context, camel-csv, commons-csv) and  java 7.
> public void configure()
>              {
>                   CsvDataFormat csv = new CsvDataFormat();
>                   csv.setDelimiter(",");
>
>                   from("file:test?noop=true")
>                  .unmarshal().csv()
>                   .split(body())
>                   .to("file:out");
>              }
> Please find below the stack trace.
> <http://camel.465427.n5.nabble.com/file/n5802566/errorstack.png>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Parsing-csv-data-format-tp5802566.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2