0

I am a beginner to Apache camel-aws. I am writing a program to transfer a file from one aws s3 bucket to another bucket using apache camel. I now want to log the file/object name that is being picked from s3. Could you please help me with the same? Below is my code snippet. ${file:name} works for camel FTP component, want to understand its equivalent in aws.

from("aws-s3://sourceBucket?amazonS3Client=#amazonS3Client")
                .log("The following file has been picked for file transfer    : ${file:name}")
                .routeId("Test My Files").log("Building Destination URI for fie transfer")
                .to("aws-s3://destinationBucket?amazonS3Client=#amazonS3Client")
                .log("The following file transfer has completed   : ${file:name}");

Kind regards, Kashif

Kashif Hamad
  • 21
  • 10

1 Answers1

2

No it's not the same.

You need to use the header CamelAwsS3Key

.log("The following file has been picked for file transfer: ${header.CamelAwsS3Key}")

This is set while consuming from S3 Bucket.

Oscerd
  • 1,616
  • 11
  • 14
  • Hi, Could you please help me with some links which can be helpful for me to learn and code in camel-aws efficiently? I have seen the camel documentation, but it lacks such information and is at a high level. I am looking for a detailed document. – Kashif Hamad Jan 29 '18 at 09:39
  • You can take a look a the documentation in the camel repo https://github.com/apache/camel/tree/master/components/camel-aws/src/main/docs , here you'll find all the asciidoc based on the current code, 2.21.0-SNAPSHOT – Oscerd Jan 29 '18 at 10:53