326.6. StreamList の使用

*Camel 2.18* 以降、プロデューサーは、反復子を使用してクエリーの出力をストリーミングする outputType=StreamList をサポートします。これにより、ストリーミング方式でデータを処理できます。たとえば、スプリッター EIP で各行を 1 つずつ処理し、必要に応じてデータベースからデータをロードするために使用できます。

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();