Hi Christian,

Dynamic router is exactly what I need. Thanks a lot for the tip!

Best Regards,
Sergey


-----Original Message-----
From: Christian Müller [mailto:[email protected]] 
Sent: Thursday, November 15, 2012 2:12 AM
To: [email protected]
Subject: Re: Processing large jdbc result set

What's with the dynamic router [1]? Will this work for you?

from("direct:start")
  // checks whether direct:slip should be called again
  .dynamicRouter(method(DynamicRouterTest.class, "slip"));

from("direct:slip")
  .to("sql:select top 10 * from MyTable")
  .to(“bean:process10Rows”)

[1] http://camel.apache.org/dynamic-router.html

Best,
Christian

On Wed, Nov 14, 2012 at 4:12 PM, Zhemzhitsky Sergey < 
[email protected]> wrote:

> Hello camel gurus,
>
> Could you suggest a best way to process a large jdbc result set that 
> contains, let’s say, more than 10000 rows.
>
> What I need is to fetch all the new rows from a given table when the 
> timer event fires.
> Currently jdbc components (jdbc, sql, jpa, mybatis, etc.) do not 
> support batching, so what I’d like to implement is something like this
>
> from(“timer:triggerName”)
>     .repeat(new HasMoreRowsPredicate())
>         .to(“sql:select top 10 * from MyTable”)
>         .to(“bean:process10Rows”)
>
> Loop EIP seems very similar to what I need, but it must be initialized 
> with a predefined number of repetitions.
>
> Best Regards,
> Sergey
>
>
> _______________________________________________________
> CONFIDENTIALITY NOTICE: This email and any files attached to it may be 
> confidential. If you are not the intended recipient you are notified 
> that using, copying, distributing or taking any action in reliance on 
> the contents of this information is strictly prohibited. If you have 
> received this email in error please notify the sender and delete this email.
>
>


--

Reply via email to