[ 
https://issues.apache.org/jira/browse/CAMEL-12437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435633#comment-16435633
 ] 

ASF GitHub Bot commented on CAMEL-12437:
----------------------------------------

oscerd closed pull request #2290: CAMEL-12437
URL: https://github.com/apache/camel/pull/2290
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
index df6e1c36409..2efb9904aec 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Producer.java
@@ -228,7 +228,12 @@ public void processSingleOp(final Exchange exchange) 
throws Exception {
             is = new ByteArrayInputStream(baos.toByteArray());
         }
 
-        putObjectRequest = new 
PutObjectRequest(getConfiguration().getBucketName(), determineKey(exchange), 
is, objectMetadata);
+        String bucketName = 
exchange.getIn().getHeader(S3Constants.BUCKET_NAME, String.class);
+        if (bucketName == null){
+            LOG.trace("Bucket name is not in header, using default one  
[{}]...", getConfiguration().getBucketName());
+            bucketName = getConfiguration().getBucketName();
+        }
+        putObjectRequest = new PutObjectRequest(bucketName, 
determineKey(exchange), is, objectMetadata);
 
         String storageClass = determineStorageClass(exchange);
         if (storageClass != null) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Ability to define dynamic bucket name for s3 router using standard 
> S3Constants.BUCKET_NAME supplied in header
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-12437
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12437
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-aws
>    Affects Versions: 2.20.2
>            Reporter: Aliaksandr Laptseu
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 2.22.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to