...
Code Block | ||
---|---|---|
| ||
from("jms:order.inbox") .to("sql:select order_seq.nextval from dual?outputHeader=OrderId&outputType=SelectOne") .to("jms:order.booking"); |
Using StreamList
From Camel 2.18 onwards the producer supports outputType=StreamList that uses an iterator to stream the output of the query. This allows to process the data in a streaming fashion which for example can be used by the Splitter EIP to process each row one at a time, and load data from the database as needed.
Code Block | ||||
---|---|---|---|---|
| ||||
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(); |
Header values
When performing update
operations, the SQL Component stores the update count in the following message headers:
Header | Description |
---|---|
| The number of rows updated for |
| The number of rows returned for |
| Camel 2.8: Query to execute. This query takes precedence over the query specified in the endpoint URI. Note that query parameters in the header are represented by a |
...