You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Robert Lario <ro...@visumpoint.com> on 2016/08/29 21:11:19 UTC

Route elements - Loop

I am new to camel.


I have a file that needs to be processed each day.  It contains a list of members and it is in CSV (rob,12.30,yes,1).  I want to iterate over each row in the file and insert the information into a sql DB.


I am looking at using "unmarshal" and the "JDBC" in the route.  What I am unsure on is the pattern for iterating over each line to do the insert.  Should I be using "loop".  Anybody got an example of iterating over a CSV file inserting rows into a DB?


Thanks for your help.

Re: Route elements - Loop

Posted by Brad Johnson <br...@mediadriver.com>.
from("file://foo.txt").split().tokenize("\n").streaming().to(...)

I'll commonly send them to a SEDA queue for processing. Then you can
specify a thread pool on the SEDA queue and consume from it to insert into
the database.

Brad

On Tue, Aug 30, 2016 at 8:27 AM, raercules <ro...@visumpoint.com>
wrote:

> Thanks for the tip.  Unfortunately, the one area I was interested in "Data"
> is empty.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Route-elements-Loop-tp5786975p5786992.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Route elements - Loop

Posted by raercules <ro...@visumpoint.com>.
Thanks for the tip.  Unfortunately, the one area I was interested in "Data"
is empty. 



--
View this message in context: http://camel.465427.n5.nabble.com/Route-elements-Loop-tp5786975p5786992.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Route elements - Loop

Posted by "Allan C." <al...@gmail.com>.
The people at Fuse and Camel has made available tons of materials and
samples for reference. Try this
https://github.com/FuseByExample/camel-persistence-part2

Regards,
Allan C.

On Tue, Aug 30, 2016 at 5:11 AM, Robert Lario <ro...@visumpoint.com>
wrote:

> I am new to camel.
>
>
> I have a file that needs to be processed each day.  It contains a list of
> members and it is in CSV (rob,12.30,yes,1).  I want to iterate over each
> row in the file and insert the information into a sql DB.
>
>
> I am looking at using "unmarshal" and the "JDBC" in the route.  What I am
> unsure on is the pattern for iterating over each line to do the insert.
> Should I be using "loop".  Anybody got an example of iterating over a CSV
> file inserting rows into a DB?
>
>
> Thanks for your help.
>