Hi,

Thanks for your response. My route is as follows:

public class CamelRoute extends RouteBuilder {

        public void configure() throws Exception {
                
                from("timer:foo?period=5000").
                        setBody(
                         constant("select dz.xx, dz.embargo from sections dz 
where dz.xx in
(65025,80269,85648,86235,86236,86237,86240,94355,94970)")).
                to("jdbc:dataSource").
                        choice().
                                when(header("CamelJdbcRowCount").isEqualTo(0)).
                                when(body().isEqualTo(new ArrayList<Long>())).
                                        setBody(constant("ResultSet is empty")).
                                       
to("log:org.camel.test?level=DEBUG").
                                otherwise().
                                        splitter(body(), 
true).to("bean:processor?method=processMessage").
                                                setBody(constant("delete from 
sections")).
                                                to("jdbc:dataSource").
                                                
setBody(header("jdbc.updateCount").convertTo(String.class)).
                                                
to("log:org.camle.test?level=DEBUG");
        }
        
}

Timer fires every 5 seconds, retrieve records from database, splits its, and
for each record calls bean's method (processMessage). This method creates
quartz's job for certains records (there was about 100 quartz's tasks where
timer was stopped).

Cheers,
Marcin

 
-- 
View this message in context: 
http://old.nabble.com/camel-and-too-many-threads--tp27285126p27304185.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to