camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Jacob <cjaco...@aol.com>
Subject Re: Processing VERY large result sets
Date Mon, 14 Nov 2016 10:04:09 GMT
Meanwhile, I found a way how to solve it. It may not be the best one, but it
works.
I programmed a custom processor. In the process method of this processor, I
navigated from the exchange to the camel context, took its registry, and
from that the sql datasource. The sql datasource has a java.sql.Connection.
With that connection, I issued the select statement and iterated through the
result set. Like in Camel, I mapped each row of the result set to a
Map<String, Object>. This map I added to a List. When the size of the list
exceeds a configurable limit, I put the List into the body of the current
exchange and sent it to an  appropriate endpoint, where it is further
processed, e.g. produce a Camel file. Clear the list and continue to iterate
through the resultset until it is finished. Don't forget to send the list
once more to the endpoint after the iteration loop if the list is not empty.
Maybe someone who has more knowledge about programming endpoints can take
these hints to implement this solution as an endpoint instead of a custom
processor...



--
View this message in context: http://camel.465427.n5.nabble.com/Processing-VERY-large-result-sets-tp5790018p5790107.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message