Alvin Kwekel created CAMEL-18619:
------------------------------------

             Summary: Stream closed for onException with useOriginalMessage
                 Key: CAMEL-18619
                 URL: https://issues.apache.org/jira/browse/CAMEL-18619
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 3.18.2, 3.18.1, 3.18.0
            Reporter: Alvin Kwekel


I seems that using onException().useOriginalMessage() with a stream input will 
always result in a closed stream. Uncached streams are closed upon reading and 
cached stream are since 3.18 also closed when converted.

"Converter for InputStream to byte[] should close stream"
https://issues.apache.org/jira/browse/CAMEL-18226

When there is for example an .unmarshal().json() step in the route, and the 
exchange fails after this step, the original stream is closed and can't be used 
in the onException block.

To demo the behavior I've created a simple example project: 
https://github.com/alvinkwekel/camel-steam-exception-example/tree/main/src/main/java/com/example/camel



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to