camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patelp7 <priyanka.pa...@optimalstrategix.com>
Subject camel-jdbc fetchSize out of memory error
Date Mon, 23 May 2016 16:01:03 GMT
I am trying to ingest data from postgres to another DB and I am using
camel-jdbc component to do it. I have a large table so I want to read few
rows at a time instead of the whole table altogether. so my route looks like
below (only for testing purpose)
from(fromUri).setBody("select * from 
 limit
10").to("jdbc://myDataSource?resetAutoCommit=false&statement.fetchSize=2").split(body()).streaming().process(test)

As shown above, I am only getting 10 rows at a time for testing purpose and
I have set fetchSize to 2 to only receive 2 rows at a time. However, I am
still receiving all 10 rows altogether. When I remove the "limit 10" from
the query I get Out of Memory error just before the split command which
tells me that its trying to load the entire result set in memory.

What am I missing here or what am I doing wrong? 

Thanks for help.



--
View this message in context: http://camel.465427.n5.nabble.com/camel-jdbc-fetchSize-out-of-memory-error-tp5782974.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message