简体   繁体   中英

How does Streaming work for a Mule Database connector?

I have a flow listening on HTTP listener and the flow has below message processors

  1. A Streaming enabled Oracle Database message processor which selects 100 records from a table and with Fetch Size 20.
  2. An expression component which transforms the above paylod of type org.mule.module.db.internal.result.resultset.ResultSetIterator into a payload of type java.util.List

As per my understanding the payload size would be 20, as Fetch Size is set to 20. But when I log the payload size, it is 100.

Can anyone suggest whether my understanding about the Streaming of Database connector is correct or not?

By doing this:

"org.mule.module.db.internal.result.resultset.ResultSetIterator into a payload of type java.util.List"

you are reading it all into memory in one go. You need to use the iterator to process each set of 20 records. Something like this simple example:

http://grepcode.com/file/repo1.maven.org/maven2/org.mule.modules/mule-module-db/3.5.0/integration/select/select-streaming-chunk-config.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM