Repository: camel
Updated Branches:
  refs/heads/master 6e936bb7b -> 94a10c42e


CAMEL-11697 - S3 Consumer: If maxMessagesPerPoll is greater than 50 consumer 
fails to poll objects from bucket


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/58bfe200
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/58bfe200
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/58bfe200

Branch: refs/heads/master
Commit: 58bfe20014f6dd46783f963c4e7674fe7ab7fd59
Parents: 6e936bb
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Wed Aug 23 15:22:23 2017 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Wed Aug 23 15:22:23 2017 +0200

----------------------------------------------------------------------
 .../camel/component/aws/s3/S3Configuration.java      | 15 +++++++++++++--
 .../apache/camel/component/aws/s3/S3Endpoint.java    |  5 +++++
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/58bfe200/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
index 03f17b1..7cf7fb3 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Configuration.java
@@ -66,6 +66,8 @@ public class S3Configuration implements Cloneable {
     private S3Operations operation;
     @UriParam(label = "consumer", defaultValue = "true")
     private boolean autocloseBody = true;
+    @UriParam(label = "consumer", defaultValue = "50")
+    private int maxConnections = 50;
 
     public long getPartSize() {
         return partSize;
@@ -311,9 +313,18 @@ public class S3Configuration implements Cloneable {
         this.autocloseBody = autocloseBody;
     }
 
+    public int getMaxConnections() {
+        return maxConnections;
+    }
+
+    /**
+     * Set the maxConnections parameter in the S3 client configuration
+     */
+    public void setMaxConnections(int maxConnections) {
+        this.maxConnections = maxConnections;
+    }
+
     boolean hasProxyConfiguration() {
         return ObjectHelper.isNotEmpty(getProxyHost()) && 
ObjectHelper.isNotEmpty(getProxyPort());
     }
-    
-    
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/58bfe200/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
index e338527..16e74bd 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/s3/S3Endpoint.java
@@ -240,6 +240,11 @@ public class S3Endpoint extends ScheduledPollEndpoint {
             clientConfiguration = new ClientConfiguration();
             clientConfiguration.setProxyHost(configuration.getProxyHost());
             clientConfiguration.setProxyPort(configuration.getProxyPort());
+            
clientConfiguration.setMaxConnections(configuration.getMaxConnections());
+            isClientConfigFound = true;
+        } else {
+            clientConfiguration = new ClientConfiguration();
+            
clientConfiguration.setMaxConnections(configuration.getMaxConnections());
             isClientConfigFound = true;
         }
         if (configuration.getAccessKey() != null && 
configuration.getSecretKey() != null) {

Reply via email to