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 Details

    • ExtendedAsyncClientConfiguration

      public ExtendedAsyncClientConfiguration()
    • ExtendedAsyncClientConfiguration

      public ExtendedAsyncClientConfiguration(ExtendedAsyncClientConfiguration other)
  • 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 class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
    • setLegacyReservedAttributeNameDisabled

      public void setLegacyReservedAttributeNameDisabled()
      Disables the utilization legacy payload attribute name when sending messages.
    • withLegacyReservedAttributeNameDisabled

      public ExtendedAsyncClientConfiguration 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

      public ExtendedAsyncClientConfiguration withIgnorePayloadNotFound(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
      Returns:
      the updated ExtendedAsyncClientConfiguration object.
    • setS3KeyPrefix

      public void setS3KeyPrefix(String s3KeyPrefix)
      Sets a string that will be used as prefix of the S3 Key.
      Parameters:
      s3KeyPrefix - A S3 key prefix value
    • withS3KeyPrefix

      public ExtendedAsyncClientConfiguration withS3KeyPrefix(String s3KeyPrefix)
      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

      public String 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

      public ExtendedAsyncClientConfiguration withAlwaysThroughS3(boolean alwaysThroughS3)
      Overrides:
      withAlwaysThroughS3 in class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
    • withObjectCannedACL

      public ExtendedAsyncClientConfiguration withObjectCannedACL(software.amazon.awssdk.services.s3.model.ObjectCannedACL objectCannedACL)
      Overrides:
      withObjectCannedACL in class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
    • withPayloadSizeThreshold

      public ExtendedAsyncClientConfiguration withPayloadSizeThreshold(int payloadSizeThreshold)
      Overrides:
      withPayloadSizeThreshold in class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
    • withPayloadSupportDisabled

      public ExtendedAsyncClientConfiguration withPayloadSupportDisabled()
      Overrides:
      withPayloadSupportDisabled in class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration
    • withServerSideEncryption

      public ExtendedAsyncClientConfiguration withServerSideEncryption(software.amazon.payloadoffloading.ServerSideEncryptionStrategy serverSideEncryption)
      Overrides:
      withServerSideEncryption in class software.amazon.payloadoffloading.PayloadStorageAsyncConfiguration