Setting the "CamelAwsS3Key" header in cAWSS3 to use Camel simple language "${...}"

Problem Description

Adding the header "CamelAwsS3Key" in the cAWSS3 component, and setting the value of the header with simple language "${...}".

However the simple language "${...}" is not resolved and the result is that the S3 filename seen in AWS is literally "${...}".

 

How do you set the S3 filename with simple language "${...}" so that the filename is dynamic?

 

Root Cause

You can't use simple language "${...}" directly in a cAWSS3 component.

 

Solution

  1. Add a cSetHeader component before the cAWSS3 component.
  2. In the cSetHeader component, add the header "CamelAwsS3Key" and set its value using simple language "${...}" as usual.
  3. Remove "CamelAwsS3Key" from the cAWSS3 component (if you haven't already done so), as the cAWSS3 component uses the "CamelAwsS3Key" header that is coming from the cSetHeader component.
  4. If the cAWSS3 component requires you to add at least one header, then you can add any other header, for example, CamelAwsS3ContentType.
Version history
Revision #:
8 of 8
Last update:
‎09-11-2019 03:07 PM
Updated by: