Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17025

camel-aws-s3 - Allow moveAfterRead in same bucket for AWS S3 consumer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 4.x
    • camel-aws, camel-aws2
    • None
    • Unknown

    Description

      Using the AWS2 S3 component it would be nice to have a way to move a file inside a different subfolder in the same bucket after reading it.

      AS IS

      With the current implementation, the moveAfterRead option requires to specify the destination bucket and eventually a prefix and/or suffix.

      As it is not intended for moving into a different folder in the same bucket, trying to specify the original bucket as destination and the path to the subfolder as a prefix has an ugly result, as shown in the following example.

      Original bucket: myBucket
      File path: /path/to/foloder/run/test.txt

      moveAfterRead=true
      destinationBucket=myBucket
      destinationBucketPrefix=/path/to/folder/done

      Result:  file is moved, but file key is /path/to/folder/done/path/to/folder/test.txt

      TO BE

      Allow moving the file under a different folder in the same bucket.

      An option would be to recognize if the destination bucket is the same as the original bucket, requiring the destinationBuketPrefix to be set, moving the file (with the filename extracted from the CamelAwsS3Key) under the specified prefix.

      Another option would be to introduce a new option designed specifically to move the file within the same bucket. The moveAfterRead option would then require either the destinationBucket option or the destinationSubfolderPrefix to be set.

      In case the second solution is chosen, the destinationBucketSuffix option could be renamed in destinationSuffix to be used with both moving within the bucket or to another bucket or a new option (destinationSubfolderSuffix) should be introduced.

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            f.zani Fabio Zani
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: