Struct aws_sdk_sqs::operation::change_message_visibility::builders::ChangeMessageVisibilityFluentBuilder
source · pub struct ChangeMessageVisibilityFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to ChangeMessageVisibility
.
Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.
For example, if the default timeout for a queue is 60 seconds, 15 seconds have elapsed since you received the message, and you send a ChangeMessageVisibility call with VisibilityTimeout
set to 10 seconds, the 10 seconds begin to count from the time that you make the ChangeMessageVisibility
call. Thus, any attempt to change the visibility timeout or to delete that message 10 seconds after you initially change the visibility timeout (a total of 25 seconds) might result in an error.
An Amazon SQS message has three basic states:
-
Sent to a queue by a producer.
-
Received from the queue by a consumer.
-
Deleted from the queue.
A message is considered to be stored after it is sent to a queue by a producer, but not yet received from the queue by a consumer (that is, between states 1 and 2). There is no limit to the number of stored messages. A message is considered to be in flight after it is received from a queue by a consumer, but not yet deleted from the queue (that is, between states 2 and 3). There is a limit to the number of in flight messages.
Limits that apply to in flight messages are unrelated to the unlimited number of stored messages.
For most standard queues (depending on queue traffic and message backlog), there can be a maximum of approximately 120,000 in flight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns the OverLimit
error message. To avoid reaching the limit, you should delete messages from the queue after they're processed. You can also increase the number of queues you use to process your messages. To request a limit increase, file a support request.
For FIFO queues, there can be a maximum of 20,000 in flight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns no error messages.
If you attempt to set the VisibilityTimeout
to a value greater than the maximum time left, Amazon SQS returns an error. Amazon SQS doesn't automatically recalculate and increase the timeout to the maximum remaining time.
Unlike with a queue, when you change the visibility timeout for a specific message the timeout value is applied immediately but isn't saved in memory for that message. If you don't delete a message after it is received, the visibility timeout for the message reverts to the original timeout value (not to the value you set using the ChangeMessageVisibility
action) the next time the message is received.
Implementations§
source§impl ChangeMessageVisibilityFluentBuilder
impl ChangeMessageVisibilityFluentBuilder
sourcepub fn as_input(&self) -> &ChangeMessageVisibilityInputBuilder
pub fn as_input(&self) -> &ChangeMessageVisibilityInputBuilder
Access the ChangeMessageVisibility as a reference.
sourcepub async fn send(
self
) -> Result<ChangeMessageVisibilityOutput, SdkError<ChangeMessageVisibilityError, HttpResponse>>
pub async fn send( self ) -> Result<ChangeMessageVisibilityOutput, SdkError<ChangeMessageVisibilityError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<ChangeMessageVisibilityOutput, ChangeMessageVisibilityError, Self>
pub fn customize( self ) -> CustomizableOperation<ChangeMessageVisibilityOutput, ChangeMessageVisibilityError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn queue_url(self, input: impl Into<String>) -> Self
pub fn queue_url(self, input: impl Into<String>) -> Self
The URL of the Amazon SQS queue whose message's visibility is changed.
Queue URLs and names are case-sensitive.
sourcepub fn set_queue_url(self, input: Option<String>) -> Self
pub fn set_queue_url(self, input: Option<String>) -> Self
The URL of the Amazon SQS queue whose message's visibility is changed.
Queue URLs and names are case-sensitive.
sourcepub fn get_queue_url(&self) -> &Option<String>
pub fn get_queue_url(&self) -> &Option<String>
The URL of the Amazon SQS queue whose message's visibility is changed.
Queue URLs and names are case-sensitive.
sourcepub fn receipt_handle(self, input: impl Into<String>) -> Self
pub fn receipt_handle(self, input: impl Into<String>) -> Self
The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the
action.ReceiveMessage
sourcepub fn set_receipt_handle(self, input: Option<String>) -> Self
pub fn set_receipt_handle(self, input: Option<String>) -> Self
The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the
action.ReceiveMessage
sourcepub fn get_receipt_handle(&self) -> &Option<String>
pub fn get_receipt_handle(&self) -> &Option<String>
The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the
action.ReceiveMessage
sourcepub fn visibility_timeout(self, input: i32) -> Self
pub fn visibility_timeout(self, input: i32) -> Self
The new value for the message's visibility timeout (in seconds). Values range: 0
to 43200
. Maximum: 12 hours.
sourcepub fn set_visibility_timeout(self, input: Option<i32>) -> Self
pub fn set_visibility_timeout(self, input: Option<i32>) -> Self
The new value for the message's visibility timeout (in seconds). Values range: 0
to 43200
. Maximum: 12 hours.
sourcepub fn get_visibility_timeout(&self) -> &Option<i32>
pub fn get_visibility_timeout(&self) -> &Option<i32>
The new value for the message's visibility timeout (in seconds). Values range: 0
to 43200
. Maximum: 12 hours.
Trait Implementations§
source§impl Clone for ChangeMessageVisibilityFluentBuilder
impl Clone for ChangeMessageVisibilityFluentBuilder
source§fn clone(&self) -> ChangeMessageVisibilityFluentBuilder
fn clone(&self) -> ChangeMessageVisibilityFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more