Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: CAMEL-7991

...

Info
titlePrerequisites

You must have a valid Amazon Web Services developer account, and be signed up to use Amazon S3. More information are available at Amazon S3.

URI Format

Code Block

aws-s3://bucket-name[?options]

...

Name

Default Value

Context

Description

amazonS3Client

null

Shared

Reference to a com.amazonaws.services.sqs.AmazonS3 in the Registry.

accessKey

null

Shared

Amazon AWS Access Key

secretKey

null

Shared

Amazon AWS Secret Key

amazonS3Endpoint

null

Shared

The region with which the AWS-S3 client wants to work with.

region

null

Producer

The region who the bucket is located. This option is used in the com.amazonaws.services.s3.model.CreateBucketRequest.

deleteAfterRead

true

Consumer

Delete objects from S3 after it has been retrieved.

deleteAfterWrite

false

Producer

Camel 2.11.0 Delete file object after the S3 file has been uploaded

maxMessagesPerPoll

10

Consumer

The maximum number of objects which can be retrieved in one poll. Used in in the com.amazonaws.services.s3.model.ListObjectsRequest.

policy

null

Shared

Camel 2.8.4: The policy for this queue to set in the com.amazonaws.services.s3.AmazonS3#setBucketPolicy() method.

storageClass

null

Producer

Camel 2.8.4: The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request.

prefix

null

Consumer

Camel 2.10.1: The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.

multiPartUpload

falseProducerCamel 2.15.0: If it is true, camel will upload the file with multi part format, the part size is decided by the option of partSize

partSize

25 * 1024 * 1024

ProducerCamel 2.15.0: Setup the partSize which is used in multi part upload, the default size is 25M.
Info
titleRequired S3 component options

You have to provide the amazonS3Client in the Registry or your accessKey and secretKey to access the Amazon's S3.

...

If your Camel Application is running behind a firewall or if you need to have more control over the AmazonS3 instance configuration, you can create your own instance:

Code Block

AWSCredentials awsCredentials = new BasicAWSCredentials("myAccessKey", "mySecretKey");

ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setProxyHost("http://myProxyHost");
clientConfiguration.setProxyPort(8080);

AmazonS3 client = new AmazonS3Client(awsCredentials, clientConfiguration);

registry.bind("client", client);

and refer to it in your Camel aws-s3 component configuration:

Code Block

from("aws-s3://MyBucket?amazonS3Client=#client&delay=5000&maxMessagesPerPoll=5")
.to("mock:result");

...

Code Block
xml
titlepom.xml
xml

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-aws</artifactId>
    <version>${camel-version}</version>
</dependency>

where ${camel-version} must be replaced by the actual version of Camel (2.8 or higher).

Include Page
Endpoint See Also
Endpoint See Also