326.6. 使用 StreamList
从生成者开始,Camel 2.18* 支持使用 iterator 的 outputType=StreamList 来流传输查询的输出。这允许以流方式处理数据,例如,Splitter EIP 可一次处理每行,并根据需要从数据库加载数据。
from("direct:withSplitModel")
.to("sql:select * from projects order by id?outputType=StreamList&outputClass=org.apache.camel.component.sql.ProjectModel")
.to("log:stream")
.split(body()).streaming()
.to("log:row")
.to("mock:result")
.end();