You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/01/20 12:19:49 UTC

[1/3] camel git commit: CAMEL-10729: Regen docs

Repository: camel
Updated Branches:
  refs/heads/master 6e95af29b -> 18ad62131


CAMEL-10729: Regen docs


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

Branch: refs/heads/master
Commit: 18ad62131c4f7de18d0165f5d49fffb39714d5e1
Parents: 39ea802
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jan 20 13:08:13 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jan 20 13:19:32 2017 +0100

----------------------------------------------------------------------
 components/camel-aws/src/main/docs/aws-s3-component.adoc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/18ad6213/components/camel-aws/src/main/docs/aws-s3-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/docs/aws-s3-component.adoc b/components/camel-aws/src/main/docs/aws-s3-component.adoc
index 5d1f9e1..944d851 100644
--- a/components/camel-aws/src/main/docs/aws-s3-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-s3-component.adoc
@@ -49,7 +49,7 @@ The AWS S3 Storage Service component has no options.
 
 
 // endpoint options: START
-The AWS S3 Storage Service component supports 40 endpoint options which are listed below:
+The AWS S3 Storage Service component supports 41 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -64,6 +64,7 @@ The AWS S3 Storage Service component supports 40 endpoint options which are list
 | proxyHost | common |  | String | Camel 2.16: To define a proxy host when instantiating the SQS client
 | proxyPort | common |  | Integer | Camel 2.16: Specify a proxy port to be used inside the client definition.
 | secretKey | common |  | String | Amazon AWS Secret Key
+| autocloseBody | consumer | true | boolean | If this option is true and includeBody is true then the S3Object.close() method will be called on exchange completion
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN or ERROR level and ignored.
 | deleteAfterRead | consumer | true | boolean | Delete objects from S3 after they have been retrieved. The delete is only performed if the Exchange is committed. If a rollback occurs the object is not deleted. If this option is false then the same objects will be retrieve over and over again on the polls. Therefore you need to use the Idempotent Consumer EIP in the route to filter out duplicates. You can filter using the link S3ConstantsBUCKET_NAME and link S3ConstantsKEY headers or only the link S3ConstantsKEY header.
 | fileName | consumer |  | String | To get the object from the bucket with the given file name
@@ -282,4 +283,4 @@ where `${camel-version`} must be replaced by the actual version of Camel
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
 
-* link:aws.html[AWS Component]
\ No newline at end of file
+* link:aws.html[AWS Component]


[3/3] camel git commit: CAMEL-10729: Camel-AWS: S3 autocloseBody option

Posted by ac...@apache.org.
CAMEL-10729: Camel-AWS: S3 autocloseBody option


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

Branch: refs/heads/master
Commit: 0af37d91f2394d578f200041f265a5ced095fbf7
Parents: 6e95af2
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jan 20 12:53:55 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jan 20 13:19:32 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/camel/blob/0af37d91/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 d25d0da..aafec13 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
@@ -64,6 +64,8 @@ public class S3Configuration implements Cloneable {
     private boolean pathStyleAccess;
     @UriParam(label = "producer", enums = "copyObject,deleteBucket,listBuckets")
     private S3Operations operation;
+    @UriParam(label = "consumer", defaultValue = "true")
+    private boolean autocloseBody = true;
 
     public long getPartSize() {
         return partSize;
@@ -294,7 +296,20 @@ public class S3Configuration implements Cloneable {
         this.operation = operation;
     }
 
+    public boolean isAutocloseBody() {
+        return autocloseBody;
+    }
+
+    /**
+     * If this option is true and includeBody is true, then the S3Object.close() method will be called on exchange completion
+     */
+    public void setAutocloseBody(boolean autocloseBody) {
+        this.autocloseBody = autocloseBody;
+    }
+
     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/0af37d91/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 0c8bbcd..f39463d 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
@@ -43,6 +43,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.SynchronizationAdapter;
 import org.apache.camel.util.ObjectHelper;
 
 import org.slf4j.Logger;
@@ -193,6 +194,18 @@ public class S3Endpoint extends ScheduledPollEndpoint {
                 s3Object.close();
             } catch (IOException e) {
             }
+        } else {
+            if (configuration.isAutocloseBody()) {
+                exchange.addOnCompletion(new SynchronizationAdapter() {
+                    @Override
+                    public void onDone(Exchange exchange) {
+                        try {
+                            s3Object.close();
+                        } catch (IOException e) {
+                        }
+                    }
+                });
+            }
         }
 
         return exchange;


[2/3] camel git commit: CAMEL-10729: Fixed test

Posted by ac...@apache.org.
CAMEL-10729: Fixed test


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

Branch: refs/heads/master
Commit: 39ea802e9302c6261ec0f9be0ceefe80e829b913
Parents: 0af37d9
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jan 20 13:05:27 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jan 20 13:19:32 2017 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/aws/s3/S3ComponentFileTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/39ea802e/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentFileTest.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentFileTest.java b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentFileTest.java
index 445abca..b32f3c9 100644
--- a/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentFileTest.java
+++ b/components/camel-aws/src/test/java/org/apache/camel/component/aws/s3/S3ComponentFileTest.java
@@ -88,7 +88,7 @@ public class S3ComponentFileTest extends CamelTestSupport {
 
         assertMockEndpointsSatisfied();
 
-        assertResultExchange(result.getExchanges().get(0), false);
+        assertResultExchange(result.getExchanges().get(0), true);
 
         PutObjectRequest putObjectRequest = client.putObjectRequests.get(0);
         assertEquals(getCamelBucket(), putObjectRequest.getBucketName());