Hide Forgot
Description of problem: Camel Splitter does not close Closable Iterator if a RuntimeException occurs during iteration. Version-Release number of selected component (if applicable): Camel 2.10.0 How reproducible: throw a RuntimeException in Closable Iterator in a Splitter Processor Steps to Reproduce: 1. create route .split().method(MyClosableIteratorFactory.class, "createIterator") 2. throw a RuntimeException in MyClosableIterator.next() method Actual results: close() method does not get called Expected results: close() method of Closable Iterator should get called in finally block of Camel Splitter class. Additional info:
Is this within the context of FSW or Fuse?
We encountered the issue while implementing a PoC for a customer based on JBoss Fuse Service Works 6 Beta (Build ER6).
Resetting the flags back to the state it was before Oct-24- 2PM. There was an incorrect bulk update that I'm trying to fix.
Tomo, can you try to reproduce? If this still exists in Camel 2.14.0, I guess we need to submit a pull against Camel.
The issue still exists in camel-2.14.0, however I think it's an enhancement request rather than a bug, as Iterable is not always Closeable, and there's no rule to close Iterable when it throws RuntimeException. If user provided Iterable throws RuntimeException on next() or hasNext(), then it can close itself right before throwing it. Having said that, I'll try to see if this enhancement is acceptable for Apache camel.
Can you add link the to Camel jira?
Sent a pull request to camel upstream
It has been merged into upstream