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

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



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


      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


      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.




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