camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s2010in <samir.sum...@mphasis.com>
Subject Re: Timers stop firing after certain unpredictable interval
Date Sat, 05 Feb 2011 03:19:27 GMT

Finally while trying to reproduce the defect in testcase , I was able to nail
down the problem, it would have been a easier fix if were not using new
technologies, and old time classic code reviews would have helped

Lets say we have route using Spring Route Builder

from("timer://foo?fixedRate=true&period=60000")
    	.to("bean:testService?method=checkExchange")
    	.to("jms:queue:test1");

    	from("jms:queue:test1")
    	.setHeader(Exchange.FILE_NAME, constant("received.xml"))
        .to("file:target/data/");

Service testService, method checkExchange opens a
org.apache.commons.dbcp.BasicDataSource based connection using Type 4 db2
driver and uses CallableStatement to call a stored procedure opening
connection and callable statement each run. The code will stop timer after
any unspecified number of runs, depending on free connections available and
all routes become inoperative.

The fix was indeed to close the connection and callable statement in finally
block, a big miss but never predicted this will get all camel routes to
standstill.

Wondering why the separate thread approach worked for me, when all other
timers failed, well this was something I had intentionally coded for reusing
the Connection so it worked!!
-- 
View this message in context: http://camel.465427.n5.nabble.com/Timers-stop-firing-after-certain-unpredictable-interval-tp3370457p3372178.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message