Claus Ibsen created CAMEL-24190:
-----------------------------------
Summary: camel-file - GenericFileOnCompletion should support
SynchronizationVetoable handover for stream download
Key: CAMEL-24190
URL: https://issues.apache.org/jira/browse/CAMEL-24190
Project: Camel
Issue Type: Improvement
Components: camel-file
Reporter: Claus Ibsen
{{GenericFileOnCompletion}} implements plain {{Synchronization}}, which means
it does not support handover. When a file consumer uses {{streamDownload=true}}
and the route sends to an async endpoint like {{seda:}}, the on-completion
fires immediately on the consumer thread (closing the stream via
{{releaseRetrievedFileResources}}), before the downstream seda consumer thread
has a chance to read the stream content.
If {{GenericFileOnCompletion}} implemented {{SynchronizationVetoable}} with
{{allowHandover() = true}}, the synchronization would transfer to the
downstream thread and fire only after that thread finishes processing. This
would make {{streamDownload=true}} safe to use with async endpoints like
{{seda:}} and {{jms:}}.
However, handover also means the completion runs on a different thread and
could be deferred if the downstream queue is busy, which has implications for
resource management (file handles, connections staying open longer).
This affects all file-based consumers: camel-file, camel-ftp, camel-sftp,
camel-smb.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)