[ https://issues.apache.org/jira/browse/CAMEL-21161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Cosentino reassigned CAMEL-21161: ---------------------------------------- Assignee: Andrea Cosentino > camel-aws2-s3 is uploading always files as multipart when multiPartUpload is > set true > ------------------------------------------------------------------------------------- > > Key: CAMEL-21161 > URL: https://issues.apache.org/jira/browse/CAMEL-21161 > Project: Camel > Issue Type: Bug > Components: camel-aws2 > Affects Versions: 4.7.0 > Reporter: Guillem Folch > Assignee: Andrea Cosentino > Priority: Minor > Fix For: 4.8.0 > > Attachments: CAMEL-21161.patch > > > The Camel component camel-aws2-s3 has a producer boolean option called > multiPartUpload. > Based on the documentation, when this attribute is set to true, the upload > will be with multipart format in case the file is larger than the partSize > (another attribute). > This is not happening, when multiPartUpload is set to true, the upload is > always in multipart format unless the fileSize is 0, which is a corner case. > The root cause of the problem is in the AWS2S3Producer code around line 151. > _long partSize = getConfiguration().getPartSize();_ > _if (contentLength == 0 && contentLength < partSize) {_ > _// optimize to do a single op if content length is known and < > part size_ > _LOG.debug("File size < partSize. Uploading file in single > operation: {}", filePayload);_ > _processSingleOp(exchange);_ > _return;_ > _}_ > If the contentLength is not 0, the condition "{_}contentLength < partSize"{_} > is never met so the upload is always done as multipart. > This is really affecting performance upload when files are below the partSize. > The proposed fix is just to change the condition to: > _if (contentLength == 0 || contentLength < partSize) {_ > _..._ -- This message was sent by Atlassian Jira (v8.20.10#820010)