libZSservicesZSamazonka-sqsZSamazonka-sqs
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.SQS.ChangeMessageVisibility

Description

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, you have a message with a visibility timeout of 5 minutes. After 3 minutes, you call ChangeMessageVisibility with a timeout of 10 minutes. You can continue to call ChangeMessageVisibility to extend the visibility timeout to the maximum allowed time. If you try to extend the visibility timeout beyond the maximum, your request is rejected.

An Amazon SQS message has three basic states:

  1. Sent to a queue by a producer.
  2. Received from the queue by a consumer.
  3. 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 inflight messages.

Limits that apply to inflight 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 inflight 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 inflight 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.

Synopsis

Creating a Request

data ChangeMessageVisibility Source #

See: newChangeMessageVisibility smart constructor.

Constructors

ChangeMessageVisibility' 

Fields

  • queueUrl :: Text

    The URL of the Amazon SQS queue whose message's visibility is changed.

    Queue URLs and names are case-sensitive.

  • receiptHandle :: Text

    The receipt handle associated with the message whose visibility timeout is changed. This parameter is returned by the ReceiveMessage action.

  • visibilityTimeout :: Int

    The new value for the message's visibility timeout (in seconds). Values range: 0 to 43200. Maximum: 12 hours.

Instances

Instances details
Eq ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Read ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Show ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Generic ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Associated Types

type Rep ChangeMessageVisibility :: Type -> Type #

NFData ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Methods

rnf :: ChangeMessageVisibility -> () #

Hashable ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

AWSRequest ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

ToHeaders ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

ToPath ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

ToQuery ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

type Rep ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

type Rep ChangeMessageVisibility = D1 ('MetaData "ChangeMessageVisibility" "Amazonka.SQS.ChangeMessageVisibility" "libZSservicesZSamazonka-sqsZSamazonka-sqs" 'False) (C1 ('MetaCons "ChangeMessageVisibility'" 'PrefixI 'True) (S1 ('MetaSel ('Just "queueUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "receiptHandle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "visibilityTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))
type AWSResponse ChangeMessageVisibility Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

newChangeMessageVisibility Source #

Create a value of ChangeMessageVisibility with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:queueUrl:ChangeMessageVisibility', changeMessageVisibility_queueUrl - The URL of the Amazon SQS queue whose message's visibility is changed.

Queue URLs and names are case-sensitive.

$sel:receiptHandle:ChangeMessageVisibility', changeMessageVisibility_receiptHandle - The receipt handle associated with the message whose visibility timeout is changed. This parameter is returned by the ReceiveMessage action.

$sel:visibilityTimeout:ChangeMessageVisibility', changeMessageVisibility_visibilityTimeout - The new value for the message's visibility timeout (in seconds). Values range: 0 to 43200. Maximum: 12 hours.

Request Lenses

changeMessageVisibility_queueUrl :: Lens' ChangeMessageVisibility Text Source #

The URL of the Amazon SQS queue whose message's visibility is changed.

Queue URLs and names are case-sensitive.

changeMessageVisibility_receiptHandle :: Lens' ChangeMessageVisibility Text Source #

The receipt handle associated with the message whose visibility timeout is changed. This parameter is returned by the ReceiveMessage action.

changeMessageVisibility_visibilityTimeout :: Lens' ChangeMessageVisibility Int Source #

The new value for the message's visibility timeout (in seconds). Values range: 0 to 43200. Maximum: 12 hours.

Destructuring the Response

data ChangeMessageVisibilityResponse Source #

See: newChangeMessageVisibilityResponse smart constructor.

Instances

Instances details
Eq ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Read ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Show ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Generic ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

Associated Types

type Rep ChangeMessageVisibilityResponse :: Type -> Type #

NFData ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

type Rep ChangeMessageVisibilityResponse Source # 
Instance details

Defined in Amazonka.SQS.ChangeMessageVisibility

type Rep ChangeMessageVisibilityResponse = D1 ('MetaData "ChangeMessageVisibilityResponse" "Amazonka.SQS.ChangeMessageVisibility" "libZSservicesZSamazonka-sqsZSamazonka-sqs" 'False) (C1 ('MetaCons "ChangeMessageVisibilityResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newChangeMessageVisibilityResponse :: ChangeMessageVisibilityResponse Source #

Create a value of ChangeMessageVisibilityResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.