AWS S3 Storage Service
Store and retrieve objects from AWS S3 Storage Service.
What’s inside
-
AWS S3 Storage Service component, URI syntax:
aws2-s3://bucketNameOrArn
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-aws2-s3-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 65 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.aws2-s3.access-key | The access key ID of the AWS credentials, used together with the secretKey option. The endpoint requires it, unless amazonS3Client is set or useDefaultCredentialsProvider, useProfileCredentialsProvider or useSessionCredentials is true. It is also required when useSessionCredentials is true. | String | |
camel.component.aws2-s3.amazon-s3-client | To use a custom software.amazon.awssdk.services.s3.S3Client, which is autowired when the registry has a single one. When this option is set, the credentials, region, proxy, endpoint override, forcePathStyle and trustAllCertificates options are not used for the client. The endpoint does not close a client that is set or autowired. The option is a software.amazon.awssdk.services.s3.S3Client type. | S3Client | |
camel.component.aws2-s3.amazon-s3-presigner | To use a custom software.amazon.awssdk.services.s3.presigner.S3Presigner for the createDownloadLink and createUploadLink operations, which is autowired when the registry has a single one. When it is not set, the producer creates a presigner for each link from the credentials, region, forcePathStyle and uriEndpointOverride options, and closes it after use. The option is a software.amazon.awssdk.services.s3.presigner.S3Presigner type. | S3Presigner | |
camel.component.aws2-s3.auto-create-bucket | Whether to create the bucket (CreateBucket) when the endpoint starts and HeadBucket answers that it does not exist. With moveAfterRead, the consumer also creates the destinationBucket. When false, a missing bucket is not created, and the operations on it fail. Not used when fileName is set. | false | Boolean |
camel.component.aws2-s3.autoclose-body | Whether the consumer closes the object stream when the exchange completes, when includeBody is false and the body is the stream. When false, the route must close the stream, otherwise the HTTP connection that it holds does not go back to the connection pool of the S3 client. Not used when includeBody is true, as the stream is then closed once read. | true | Boolean |
camel.component.aws2-s3.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.aws2-s3.aws-k-m-s-key-id | The AWS KMS key (key ID, key ARN or alias) that encrypts the uploaded objects when useAwsKMS is true. | String | |
camel.component.aws2-s3.batch-message-number | The number of messages after which a batch is complete in streaming upload mode: its object is uploaded, and the next message starts a new object. | 10 | Integer |
camel.component.aws2-s3.batch-size | The size in bytes after which a batch is complete in streaming upload mode: when the buffered data reaches it, the object is uploaded and the next data starts a new object, so the data of a large message can be split between two objects. | 1000000 | Integer |
camel.component.aws2-s3.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. 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. | false | Boolean |
camel.component.aws2-s3.buffer-size | The number of bytes that the producer reads from the message body at a time in streaming upload mode, when multiPartUpload is false (with multiPartUpload, it reads up to partSize bytes). The batchSize is checked after each read. | 1000000 | Integer |
camel.component.aws2-s3.conditional-writes-enabled | Whether an upload stores the object only if no object with its key exists in the bucket yet: the producer sends If-None-Match: * with PutObject and with CompleteMultipartUpload, and S3 rejects the upload with the status 412 (Precondition Failed) when the key exists. Not used by copyObject, nor in streaming upload mode. | false | Boolean |
camel.component.aws2-s3.configuration | The component configuration. The option is a org.apache.camel.component.aws2.s3.AWS2S3Configuration type. | AWS2S3Configuration | |
camel.component.aws2-s3.customer-algorithm | The encryption algorithm of SSE-C, used when useCustomerKey is true. S3 supports only AES256. | String | |
camel.component.aws2-s3.customer-key-id | The customer-provided key of SSE-C, used when useCustomerKey is true: the 256-bit key itself, base64-encoded, not an ID. In an endpoint URI, use RAW() around it, as a base64 value can contain + and / characters. | String | |
camel.component.aws2-s3.customer-key-m-d5 | The base64-encoded 128-bit MD5 digest of the customer-provided key of customerKeyId, which S3 uses to check that it received the key without error. Used when useCustomerKey is true. | String | |
camel.component.aws2-s3.delete-after-read | Whether to delete each consumed object from the bucket after its exchange completes successfully. If the exchange fails, the object is not deleted, and a later poll consumes it again. When false, the polls consume the same objects again and again: use the Idempotent Consumer EIP to filter out the duplicates, for example on the CamelAwsS3Key header. With moveAfterRead, the object is deleted after it is copied. | true | Boolean |
camel.component.aws2-s3.delete-after-write | Whether to delete the local file after it is uploaded, when the message body is a java.io.File (for example from the file component). Bodies of other types are not affected. Not used in streaming upload mode. | false | Boolean |
camel.component.aws2-s3.delimiter | The delimiter of the ListObjectsV2 request of the consumer and of the listObjects operation, where the CamelAwsS3Delimiter header replaces it. S3 groups the keys that contain the delimiter after the prefix into common prefixes and does not return them as objects: for example the delimiter / with the prefix logs/ lists only the objects directly under logs/, not those under logs/2024/. | String | |
camel.component.aws2-s3.destination-bucket | The bucket that moveAfterRead copies the consumed objects to. The consumer checks at startup that it exists, and creates it when autoCreateBucket is true. | String | |
camel.component.aws2-s3.destination-bucket-prefix | A prefix that moveAfterRead puts before the key of the object in the destinationBucket, for example archive/. It can be a Simple expression, evaluated with the exchange of the object. | String | |
camel.component.aws2-s3.destination-bucket-suffix | A suffix that moveAfterRead appends to the key of the object in the destinationBucket, after its extension, for example .processed. It can be a Simple expression, evaluated with the exchange of the object. | String | |
camel.component.aws2-s3.done-file-name | The key of a done file: when it is set, a poll consumes objects only when an object with this key exists in the bucket (checked with HeadObject at the start of each poll). It is one fixed key, not a pattern. The done file is listed and consumed like the other objects, unless the prefix option leaves it out. | String | |
camel.component.aws2-s3.enabled | Whether to enable auto configuration of the aws2-s3 component. This is enabled by default. | Boolean | |
camel.component.aws2-s3.file-name | The key of the one object to consume. When it is set, each poll gets this object instead of listing the bucket, and the endpoint does not check at startup that the bucket exists (so autoCreateBucket and policy are not applied). | String | |
camel.component.aws2-s3.force-path-style | Whether the S3 client uses path-style requests, with the bucket name in the path of the URL (https://s3.eu-west-1.amazonaws.com/mybucket/key), instead of virtual-hosted-style requests, with the bucket name in the host name (https://mybucket.s3.eu-west-1.amazonaws.com/key). Many S3-compatible stores used with uriEndpointOverride need it. | false | Boolean |
camel.component.aws2-s3.health-check-consumer-enabled | Used for enabling or disabling all consumer based health checks from this component | true | Boolean |
camel.component.aws2-s3.health-check-producer-enabled | Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true. | true | Boolean |
camel.component.aws2-s3.ignore-body | Whether to get only the metadata of the objects, without their content: the consumer and the getObject operation send a HeadObject request instead of GetObject, set the same headers, and set no body (the consumer) or keep the body (getObject). The headBucket operation then keeps the body too. It takes precedence over includeBody. | false | Boolean |
camel.component.aws2-s3.include-body | Whether the consumer reads the content of each object into the message body as a byte array, and then closes the object stream. When false, the body is the object stream itself (a ResponseInputStream of the AWS SDK), which holds an HTTP connection of the S3 client until it is closed: autocloseBody closes it when the exchange completes, otherwise the route must close it. ignoreBody takes precedence over this option. | true | Boolean |
camel.component.aws2-s3.include-folders | Whether the consumer consumes the folder objects, the objects whose Content-Type is application/x-directory (such as the S3 console creates for a folder). When false, they are skipped and stay in the bucket. | true | Boolean |
camel.component.aws2-s3.key-name | The key of the object for the producer operations, used when the CamelAwsS3Key header is not set. It can be a Simple expression, such as $\{header.name}, evaluated for each message. In streaming upload mode it is required, and the uploaded objects are named from it by the namingStrategy: the header and Simple expressions are not used there. | String | |
camel.component.aws2-s3.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.aws2-s3.move-after-read | Whether to copy each consumed object to the destinationBucket after its exchange completes successfully, with the key destinationBucketPrefix + key + destinationBucketSuffix. The object is removed from the bucket only by deleteAfterRead (true by default): with deleteAfterRead false, it is copied, not moved. If the exchange fails, nothing is copied. | false | Boolean |
camel.component.aws2-s3.multi-part-upload | Whether the producer uploads a body of at least partSize bytes with a multipart upload (CreateMultipartUpload, UploadPart for each part of partSize bytes, then CompleteMultipartUpload). A smaller body is uploaded with a single PutObject. If a part fails, the multipart upload is aborted. In streaming upload mode, the parts are uploaded as the data of a batch is buffered, instead of the whole batch when it is complete. | false | Boolean |
camel.component.aws2-s3.naming-strategy | How the objects of the batches are named from keyName in streaming upload mode: progressive adds a counter before the extension (the first object is keyName itself, then name-1.ext, name-2.ext and so on), random adds a random UUID, and timestamp adds the time the upload started, in milliseconds. Not used with timestampGroupingEnabled. | progressive | AWSS3NamingStrategyEnum |
camel.component.aws2-s3.operation | The operation that the producer performs. The CamelAwsS3Operation header replaces this option. When neither is set, the producer uploads the message body (PutObject, or a multipart upload with multiPartUpload). In streaming upload mode, the producer only uploads and does not use it. | AWS2S3Operations | |
camel.component.aws2-s3.override-endpoint | Whether the S3 client sends the requests to the URI of the uriEndpointOverride option instead of the S3 endpoint of the region. It has no effect when uriEndpointOverride is not set. | false | Boolean |
camel.component.aws2-s3.part-size | The size in bytes of each part of a multipart upload, used when multiPartUpload is true. A body smaller than it is uploaded with a single PutObject. S3 requires each part except the last to be at least 5 MiB (5242880 bytes), and accepts at most 10,000 parts and 5 GiB per part. In streaming upload mode, it must also fit in an int. | 26214400 | Long |
camel.component.aws2-s3.pojo-request | Whether the producer operations take their request from the message body: the request of the AWS SDK for the operation, such as a GetObjectRequest for getObject or a ListObjectsV2Request for listObjects. The upload (no operation), listBuckets, headBucket, headObject, createDownloadLink and createUploadLink do not use it. | false | Boolean |
camel.component.aws2-s3.policy | A bucket policy, as JSON, that the endpoint sets on the bucket with PutBucketPolicy when it starts. It is set only when the bucket does not exist yet, after autoCreateBucket created it: the policy of an existing bucket is not changed. | String | |
camel.component.aws2-s3.prefix | Only the objects whose key begins with this prefix are listed: by the consumer (the Prefix of its ListObjectsV2 request) and by the listObjects operation, where the CamelAwsS3Prefix header replaces it. The removePrefixOnMove option also uses it. | String | |
camel.component.aws2-s3.profile-credentials-name | The name of the profile in the AWS shared credentials and config files, used when useProfileCredentialsProvider is true. If not set, the AWS SDK uses its default profile, which the AWS_PROFILE environment variable can change. | String | |
camel.component.aws2-s3.proxy-host | The host name of the proxy that the S3 client uses. The client uses a proxy only when the proxyPort option is set too. | String | |
camel.component.aws2-s3.proxy-port | The port of the proxy that the S3 client uses. The client uses a proxy only when the proxyHost option is set too. | Integer | |
camel.component.aws2-s3.proxy-protocol | The protocol of the proxy that the S3 client uses. It is used only when the proxyHost and proxyPort options are both set. | https | Protocol |
camel.component.aws2-s3.region | The ID of the AWS region of the S3 client, in lower case, for example eu-west-1 (the value of Region.EU_WEST_1.id()). autoCreateBucket creates the bucket in this region. If not set, the AWS SDK resolves the region itself, for example from the AWS_REGION environment variable. | String | |
camel.component.aws2-s3.remove-prefix-on-move | Whether moveAfterRead removes the value of the prefix option from the start of the key in the destinationBucket. The prefix is removed from the key built from destinationBucketPrefix, the object key and destinationBucketSuffix, so it is removed only when that key starts with it, in practice when destinationBucketPrefix is not set: with the prefix demo/notify/, the object demo/notify/example.txt is copied as example.txt. | false | Boolean |
camel.component.aws2-s3.restarting-policy | Where the progressive namingStrategy starts counting when the producer starts in streaming upload mode: override starts again from keyName, so the new objects replace the objects written before; lastPart finds the most recently modified object whose key starts with keyName (without its extension) and continues after its number. Only used with the progressive namingStrategy. | override | AWSS3RestartingPolicyEnum |
camel.component.aws2-s3.secret-key | The secret access key of the AWS credentials, used together with the accessKey option. The endpoint requires it, unless amazonS3Client is set or useDefaultCredentialsProvider, useProfileCredentialsProvider or useSessionCredentials is true. It is also required when useSessionCredentials is true. | String | |
camel.component.aws2-s3.session-token | The session token of temporary AWS credentials, for example of an assumed IAM role. It is used only when useSessionCredentials is true, together with the accessKey and secretKey options. All three are then required: if one of the three is missing, creating the client fails. | String | |
camel.component.aws2-s3.storage-class | The storage class of the uploaded objects, a value of the S3 StorageClass such as STANDARD_IA, INTELLIGENT_TIERING or GLACIER. The CamelAwsS3StorageClass header replaces it. It applies to PutObject and multipart uploads, also in streaming upload mode, not to copyObject. | String | |
camel.component.aws2-s3.streaming-upload-mode | Whether the producer uploads the messages in streaming upload mode: it buffers the data of the messages and writes it to objects with multipart uploads, one object for each batch. A batch is complete at batchMessageNumber messages or batchSize bytes, when streamingUploadTimeout runs, or when the producer stops. The objects are named from keyName by the namingStrategy. In this mode the operation option and the headers that name the key or the bucket are not used. | false | Boolean |
camel.component.aws2-s3.streaming-upload-timeout | The interval in milliseconds at which the producer completes the open uploads in streaming upload mode, whatever their number of messages or size, so that buffered data does not wait for batchMessageNumber or batchSize. It is a fixed interval, not counted from the last message. 0 turns it off. | Long | |
camel.component.aws2-s3.timestamp-grouping-enabled | Whether in streaming upload mode the producer writes the messages to one object for each time window of timestampWindowSizeMillis, by the timestamp in the timestampHeaderName header, instead of naming the objects by the namingStrategy. The objects are named from keyName and the window in UTC, for example name_20240101_0800_0800-0805.txt. Only used in streaming upload mode. | false | Boolean |
camel.component.aws2-s3.timestamp-header-name | The name of the header with the timestamp of each message for timestampGroupingEnabled: a Long or a String of milliseconds since the epoch, or a java.util.Date. A message without a valid timestamp goes to the window of the current time. | CamelMessageTimestamp | String |
camel.component.aws2-s3.timestamp-window-size-millis | The length in milliseconds of the time windows of timestampGroupingEnabled. The windows start at multiples of it since the epoch: 300000 (5 minutes) gives the windows 08:00-08:05, 08:05-08:10 and so on. | 300000 | Long |
camel.component.aws2-s3.trust-all-certificates | Whether the S3 client accepts any TLS certificate of the server without checking it. It applies whether or not the endpoint is overridden. Use it only for tests, for example with a local emulator. | false | Boolean |
camel.component.aws2-s3.uri-endpoint-override | The URI that the S3 client sends the requests to, for example http://localhost:9000 for a local S3-compatible store. The client uses it only when overrideEndpoint is true, while the presigner of createDownloadLink and createUploadLink uses it whenever it is set. | String | |
camel.component.aws2-s3.use-aws-k-m-s | Whether to encrypt the uploaded objects with SSE-KMS (server-side encryption with AWS KMS keys), with the KMS key of the awsKMSKeyId option. It applies to PutObject, multipart uploads (also in streaming upload mode) and the copy of copyObject. Set awsKMSKeyId too: without it, PutObject and copyObject do not ask for SSE-KMS, while a multipart upload uses the AWS managed key aws/s3. | false | Boolean |
camel.component.aws2-s3.use-customer-key | Whether to use server-side encryption with a customer-provided key (SSE-C), the key of the customerKeyId, customerKeyMD5 and customerAlgorithm options. The key is sent with the get of each consumed object, and by the producer with PutObject, multipart uploads (also in streaming upload mode), getObject, getObjectRange and copyObject (for the source and the copy). S3 needs the same key to read an object stored with it. | false | Boolean |
camel.component.aws2-s3.use-default-credentials-provider | Whether to load the credentials with the default credentials provider chain of the AWS SDK, which looks in system properties, environment variables, the shared credentials and config files, and the container or instance role. It takes precedence over the other credentials options. | false | Boolean |
camel.component.aws2-s3.use-profile-credentials-provider | Whether to load the credentials from a profile of the AWS shared credentials and config files, the one of the profileCredentialsName option. It is not used when useDefaultCredentialsProvider is true, and it takes precedence over the session and static credentials. | false | Boolean |
camel.component.aws2-s3.use-s-s-e-s3 | Whether to encrypt the uploaded objects with SSE-S3 (server-side encryption with Amazon S3 managed keys, AES256). It applies to PutObject, multipart uploads (also in streaming upload mode) and the copy of copyObject. | false | Boolean |
camel.component.aws2-s3.use-session-credentials | Whether to use temporary credentials made of the accessKey, secretKey and sessionToken options, for example those of an assumed IAM role. It is not used when useDefaultCredentialsProvider or useProfileCredentialsProvider is true. | false | Boolean |