I would split on the route and stack the timer before. Any reason you need
it to be 2 routes?

from("timer://myTimer?period=1000")
       to("file:testcsv")
      .unmarshal().csv()
      .split()
      .to("sql:select * from test where id = ${body[id]}")
      .to("direct:point1");

The split will cause each record to process individually. Probably you have
to adjust the code above for your cases (as I am conding without putting it
in an IDE) but you get the basic idea I hope.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


On Fri, Sep 27, 2013 at 5:09 PM, Dale King <dalewk...@gmail.com> wrote:

> What you will probably want to do is do a split on the ids so you then have
> a subroute on each ID. Each subroute then needs to access the database, for
> which you will not use a from, but more probably a content enricher to read
> from the SQL endpoint.
>
>
> On Fri, Sep 27, 2013 at 6:00 PM, lumi <luminitavelic...@gmail.com> wrote:
>
> > Hi,
> > I don’t know how to pass data from one route that reads a file to another
> > route that is polling a database.
> >
> > First route reads id from file.
> >
> >       from("file:testcsv")
> >       .unmarshal().csv()
> >       .to("direct:point1");
> >
> > Second route needs to use the id in the sql
> >
> >         from("timer://myTimer?period=1000")
> >         .to("sql:select * from test where id = #")
> >         .marshal().csv()
> >         .to("file:target/out ");
> >
> >
> > With sql consumer faced the same question.
> >
> >         from ("sql:select * from test where id = #?consumer.delay=1000")
> >         .marshal().csv()
> >         .to("file:target/out");
> >
> > It seems that I’m missing something very basic here, please help.
> >
> > Thanks and regards,
> > Lumi
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/passing-data-to-a-polling-consumer-tp5740313.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Dale King
>

Reply via email to