51.7. 使用 StreamList
producer 支持 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();