Package com.amazon.sqs.javamessaging
Class ExtendedAsyncClientConfiguration
java.lang.Object
software.amazon.payloadoffloading.PayloadStorageConfigurationBase
software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
com.amazon.sqs.javamessaging.ExtendedAsyncClientConfiguration
@NotThreadSafe
public class ExtendedAsyncClientConfiguration
extends software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
Amazon SQS extended client configuration options such as async Amazon S3 client,
bucket name, and message size threshold for large-payload messages.
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether or not clean up large objects in S3 is enabled.Gets the S3 key prefixboolean
Checks whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.void
setIgnorePayloadNotFound
(boolean ignorePayloadNotFound) Sets whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.void
Disables the utilization legacy payload attribute name when sending messages.void
setPayloadSupportEnabled
(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName, boolean cleanupS3Payload) Enables asynchronous support for payload messages.void
setS3KeyPrefix
(String s3KeyPrefix) Sets a string that will be used as prefix of the S3 Key.boolean
Checks whether or not the configuration uses the legacy reserved attribute name.withAlwaysThroughS3
(boolean alwaysThroughS3) withIgnorePayloadNotFound
(boolean ignorePayloadNotFound) Sets whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.Disables the utilization legacy payload attribute name when sending messages.withObjectCannedACL
(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL) withPayloadSizeThreshold
(int payloadSizeThreshold) withPayloadSupportEnabled
(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) withPayloadSupportEnabled
(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName, boolean cleanupS3Payload) Enables asynchronous support for payload messages.withS3KeyPrefix
(String s3KeyPrefix) Sets a string that will be used as prefix of the S3 Key.withServerSideEncryption
(software.amazon.payloadoffloading.ServerSideEncryptionStrategy serverSideEncryption) Methods inherited from class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
getS3AsyncClient, setPayloadSupportDisabled, setPayloadSupportEnabled
Methods inherited from class software.amazon.payloadoffloading.PayloadStorageConfigurationBase
getObjectCannedACL, getPayloadSizeThreshold, getS3BucketName, getServerSideEncryptionStrategy, isAlwaysThroughS3, isObjectCannedACLDefined, isPayloadSupportEnabled, setAlwaysThroughS3, setObjectCannedACL, setPayloadSizeThreshold, setPayloadSupportEnabled, setServerSideEncryptionStrategy
-
Constructor Details
-
ExtendedAsyncClientConfiguration
public ExtendedAsyncClientConfiguration() -
ExtendedAsyncClientConfiguration
-
-
Method Details
-
setPayloadSupportEnabled
public void setPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName, boolean cleanupS3Payload) Enables asynchronous support for payload messages.- Parameters:
s3Async
- Amazon S3 client which is going to be used for storing payload messages.s3BucketName
- Name of the bucket which is going to be used for storing payload messages. The bucket must be already created and configured in s3.cleanupS3Payload
- If set to true, would handle deleting the S3 object as part of deleting the message from SQS queue. Otherwise, would not attempt to delete the object from S3. If opted to not delete S3 objects its the responsibility to the message producer to handle the clean up appropriately.
-
withPayloadSupportEnabled
public ExtendedAsyncClientConfiguration withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName, boolean cleanupS3Payload) Enables asynchronous support for payload messages.- Parameters:
s3Async
- Amazon S3 client which is going to be used for storing payload messages.s3BucketName
- Name of the bucket which is going to be used for storing payload messages. The bucket must be already created and configured in s3.cleanupS3Payload
- If set to true, would handle deleting the S3 object as part of deleting the message from SQS queue. Otherwise, would not attempt to delete the object from S3. If opted to not delete S3 objects its the responsibility to the message producer to handle the clean up appropriately.
-
withPayloadSupportEnabled
public ExtendedAsyncClientConfiguration withPayloadSupportEnabled(software.amazon.awssdk.services.s3.S3AsyncClient s3Async, String s3BucketName) - Overrides:
withPayloadSupportEnabled
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-
setLegacyReservedAttributeNameDisabled
public void setLegacyReservedAttributeNameDisabled()Disables the utilization legacy payload attribute name when sending messages. -
withLegacyReservedAttributeNameDisabled
Disables the utilization legacy payload attribute name when sending messages. -
setIgnorePayloadNotFound
public void setIgnorePayloadNotFound(boolean ignorePayloadNotFound) Sets whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.- Parameters:
ignorePayloadNotFound
- Whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3. Default: false
-
withIgnorePayloadNotFound
Sets whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.- Parameters:
ignorePayloadNotFound
- Whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3. Default: false- Returns:
- the updated ExtendedAsyncClientConfiguration object.
-
setS3KeyPrefix
Sets a string that will be used as prefix of the S3 Key.- Parameters:
s3KeyPrefix
- A S3 key prefix value
-
withS3KeyPrefix
Sets a string that will be used as prefix of the S3 Key.- Parameters:
s3KeyPrefix
- A S3 key prefix value- Returns:
- the updated ExtendedClientConfiguration object.
-
getS3KeyPrefix
Gets the S3 key prefix- Returns:
- the prefix value which is being used for compose the S3 key.
-
doesCleanupS3Payload
public boolean doesCleanupS3Payload()Checks whether or not clean up large objects in S3 is enabled.- Returns:
- True if clean up is enabled when deleting the concerning SQS message. Default: true
-
usesLegacyReservedAttributeName
public boolean usesLegacyReservedAttributeName()Checks whether or not the configuration uses the legacy reserved attribute name.- Returns:
- True if legacy reserved attribute name is used. Default: true
-
ignoresPayloadNotFound
public boolean ignoresPayloadNotFound()Checks whether or not messages should be removed from Amazon SQS when payloads are not found in Amazon S3.- Returns:
- True if messages should be removed from Amazon SQS when payloads are not found in Amazon S3. Default: false
-
withAlwaysThroughS3
- Overrides:
withAlwaysThroughS3
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-
withObjectCannedACL
public ExtendedAsyncClientConfiguration withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL) - Overrides:
withObjectCannedACL
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-
withPayloadSizeThreshold
- Overrides:
withPayloadSizeThreshold
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-
withPayloadSupportDisabled
- Overrides:
withPayloadSupportDisabled
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-
withServerSideEncryption
public ExtendedAsyncClientConfiguration withServerSideEncryption(software.amazon.payloadoffloading.ServerSideEncryptionStrategy serverSideEncryption) - Overrides:
withServerSideEncryption
in classsoftware.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
-