Class QueueProps.Builder
java.lang.Object
software.amazon.awscdk.services.sqs.QueueProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<QueueProps>
- Enclosing interface:
QueueProps
@Stability(Stable)
public static final class QueueProps.Builder
extends Object
implements software.amazon.jsii.Builder<QueueProps>
A builder for
QueueProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.contentBasedDeduplication
(Boolean contentBasedDeduplication) Sets the value ofQueueProps.getContentBasedDeduplication()
dataKeyReuse
(Duration dataKeyReuse) Sets the value ofQueueProps.getDataKeyReuse()
deadLetterQueue
(DeadLetterQueue deadLetterQueue) Sets the value ofQueueProps.getDeadLetterQueue()
deduplicationScope
(DeduplicationScope deduplicationScope) Sets the value ofQueueProps.getDeduplicationScope()
deliveryDelay
(Duration deliveryDelay) Sets the value ofQueueProps.getDeliveryDelay()
encryption
(QueueEncryption encryption) Sets the value ofQueueProps.getEncryption()
encryptionMasterKey
(IKey encryptionMasterKey) Sets the value ofQueueProps.getEncryptionMasterKey()
enforceSsl
(Boolean enforceSsl) Sets the value ofinvalid @link
QueueProps#getEnforceSsl
Sets the value ofQueueProps.getFifo()
fifoThroughputLimit
(FifoThroughputLimit fifoThroughputLimit) Sets the value ofQueueProps.getFifoThroughputLimit()
maxMessageSizeBytes
(Number maxMessageSizeBytes) Sets the value ofQueueProps.getMaxMessageSizeBytes()
Sets the value ofQueueProps.getQueueName()
receiveMessageWaitTime
(Duration receiveMessageWaitTime) Sets the value ofQueueProps.getReceiveMessageWaitTime()
redriveAllowPolicy
(RedriveAllowPolicy redriveAllowPolicy) Sets the value ofQueueProps.getRedriveAllowPolicy()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofQueueProps.getRemovalPolicy()
retentionPeriod
(Duration retentionPeriod) Sets the value ofQueueProps.getRetentionPeriod()
visibilityTimeout
(Duration visibilityTimeout) Sets the value ofQueueProps.getVisibilityTimeout()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
contentBasedDeduplication
@Stability(Stable) public QueueProps.Builder contentBasedDeduplication(Boolean contentBasedDeduplication) Sets the value ofQueueProps.getContentBasedDeduplication()
- Parameters:
contentBasedDeduplication
- Specifies whether to enable content-based deduplication. During the deduplication interval (5 minutes), Amazon SQS treats messages that are sent with identical content (excluding attributes) as duplicates and delivers only one copy of the message.If you don't enable content-based deduplication and you want to deduplicate messages, provide an explicit deduplication ID in your SendMessage() call.
(Only applies to FIFO queues.)
- Returns:
this
-
dataKeyReuse
Sets the value ofQueueProps.getDataKeyReuse()
- Parameters:
dataKeyReuse
- The length of time that Amazon SQS reuses a data key before calling KMS again. The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 minutes).- Returns:
this
-
deadLetterQueue
Sets the value ofQueueProps.getDeadLetterQueue()
- Parameters:
deadLetterQueue
- Send messages to this queue if they were unsuccessfully dequeued a number of times.- Returns:
this
-
deduplicationScope
@Stability(Stable) public QueueProps.Builder deduplicationScope(DeduplicationScope deduplicationScope) Sets the value ofQueueProps.getDeduplicationScope()
- Parameters:
deduplicationScope
- For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. (Only applies to FIFO queues.)- Returns:
this
-
deliveryDelay
Sets the value ofQueueProps.getDeliveryDelay()
- Parameters:
deliveryDelay
- The time in seconds that the delivery of all messages in the queue is delayed. You can specify an integer value of 0 to 900 (15 minutes). The default value is 0.- Returns:
this
-
encryption
Sets the value ofQueueProps.getEncryption()
- Parameters:
encryption
- Whether the contents of the queue are encrypted, and by what type of key. Be aware that encryption is not available in all regions, please see the docs for current availability details.- Returns:
this
-
encryptionMasterKey
Sets the value ofQueueProps.getEncryptionMasterKey()
- Parameters:
encryptionMasterKey
- External KMS key to use for queue encryption. Individual messages will be encrypted using data keys. The data keys in turn will be encrypted using this key, and reused for a maximum ofdataKeyReuseSecs
seconds.If the 'encryptionMasterKey' property is set, 'encryption' type will be implicitly set to "KMS".
- Returns:
this
-
enforceSsl
Sets the value ofinvalid @link
QueueProps#getEnforceSsl
- Parameters:
enforceSsl
- Enforce encryption of data in transit.- Returns:
this
-
fifo
Sets the value ofQueueProps.getFifo()
- Parameters:
fifo
- Whether this a first-in-first-out (FIFO) queue.- Returns:
this
-
fifoThroughputLimit
@Stability(Stable) public QueueProps.Builder fifoThroughputLimit(FifoThroughputLimit fifoThroughputLimit) Sets the value ofQueueProps.getFifoThroughputLimit()
- Parameters:
fifoThroughputLimit
- For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. (Only applies to FIFO queues.)- Returns:
this
-
maxMessageSizeBytes
Sets the value ofQueueProps.getMaxMessageSizeBytes()
- Parameters:
maxMessageSizeBytes
- The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an integer value from 1024 bytes (1 KiB) to 262144 bytes (256 KiB). The default value is 262144 (256 KiB).- Returns:
this
-
queueName
Sets the value ofQueueProps.getQueueName()
- Parameters:
queueName
- A name for the queue. If specified and this is a FIFO queue, must end in the string '.fifo'.- Returns:
this
-
receiveMessageWaitTime
@Stability(Stable) public QueueProps.Builder receiveMessageWaitTime(Duration receiveMessageWaitTime) Sets the value ofQueueProps.getReceiveMessageWaitTime()
- Parameters:
receiveMessageWaitTime
- Default wait time for ReceiveMessage calls. Does not wait if set to 0, otherwise waits this amount of seconds by default for messages to arrive.For more information, see Amazon SQS Long Poll.
- Returns:
this
-
redriveAllowPolicy
@Stability(Stable) public QueueProps.Builder redriveAllowPolicy(RedriveAllowPolicy redriveAllowPolicy) Sets the value ofQueueProps.getRedriveAllowPolicy()
- Parameters:
redriveAllowPolicy
- The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues.- Returns:
this
-
removalPolicy
Sets the value ofQueueProps.getRemovalPolicy()
- Parameters:
removalPolicy
- Policy to apply when the queue is removed from the stack. Even though queues are technically stateful, their contents are transient and it is common to add and remove Queues while rearchitecting your application. The default is thereforeDESTROY
. Change it toRETAIN
if the messages are so valuable that accidentally losing them would be unacceptable.- Returns:
this
-
retentionPeriod
Sets the value ofQueueProps.getRetentionPeriod()
- Parameters:
retentionPeriod
- The number of seconds that Amazon SQS retains a message. You can specify an integer value from 60 seconds (1 minute) to 1209600 seconds (14 days). The default value is 345600 seconds (4 days).- Returns:
this
-
visibilityTimeout
Sets the value ofQueueProps.getVisibilityTimeout()
- Parameters:
visibilityTimeout
- Timeout of processing a single message. After dequeuing, the processor has this much time to handle the message and delete it from the queue before it becomes visible again for dequeueing by another processor.Values must be from 0 to 43200 seconds (12 hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<QueueProps>
- Returns:
- a new instance of
QueueProps
- Throws:
NullPointerException
- if any required attribute was not provided
-