Claus Ibsen created CAMEL-27267:
-----------------------------------

             Summary: camel-core - the binary data type keeps a File or 
WrappedFile body instead of reading it into memory
                 Key: CAMEL-27267
                 URL: https://issues.apache.org/jira/browse/CAMEL-27267
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 4.24.0


The {{application-octet-stream}} ({{binary}}) data type transformer keeps a 
stream cache body since CAMEL-27258, but it still reads a {{java.io.File}} or a 
{{WrappedFile}} body (such as the {{GenericFile}} of the file and FTP 
consumers) into a {{byte[]}}. A file is binary already and can be read again, 
and it may be large.

This blocks a {{binary}} in default on the object and file sinks of the Kamelet 
catalog (S3, Azure Storage, Google Storage, MinIO, FTP, ...): the default would 
read every file into memory before the upload.

Fix: keep a {{File}} or {{WrappedFile}} body as it is, set only the 
{{Content-Type}}, and list {{file}} in {{transformerOut}} of the 
{{@BodyTypes}}. Upgrade guide 4.24: extend the note on the binary data type.

Part of the data types work for the Kamelet catalog (camel-kamelets#3117, 
CAMEL-25928).

_Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to