import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { ChangeMessageVisibilityRequest } from "../models/models_0"; import type { ServiceInputTypes, ServiceOutputTypes, SQSClientResolvedConfig } from "../SQSClient"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link ChangeMessageVisibilityCommand}. */ export interface ChangeMessageVisibilityCommandInput extends ChangeMessageVisibilityRequest { } /** * @public * * The output of {@link ChangeMessageVisibilityCommand}. */ export interface ChangeMessageVisibilityCommandOutput extends __MetadataBearer { } declare const ChangeMessageVisibilityCommand_base: { new (input: ChangeMessageVisibilityCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: ChangeMessageVisibilityCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

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:

*
    *
  1. *

    Sent to a queue by a producer.

    *
  2. *
  3. *

    Received from the queue by a consumer.

    *
  4. *
  5. *

    Deleted from the queue.

    *
  6. *
*

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 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 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.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { SQSClient, ChangeMessageVisibilityCommand } from "@aws-sdk/client-sqs"; // ES Modules import * // const { SQSClient, ChangeMessageVisibilityCommand } = require("@aws-sdk/client-sqs"); // CommonJS import * // import type { SQSClientConfig } from "@aws-sdk/client-sqs"; * const config = {}; // type is SQSClientConfig * const client = new SQSClient(config); * const input = { // ChangeMessageVisibilityRequest * QueueUrl: "STRING_VALUE", // required * ReceiptHandle: "STRING_VALUE", // required * VisibilityTimeout: Number("int"), // required * }; * const command = new ChangeMessageVisibilityCommand(input); * const response = await client.send(command); * // {}; * * ``` * * @param ChangeMessageVisibilityCommandInput - {@link ChangeMessageVisibilityCommandInput} * @returns {@link ChangeMessageVisibilityCommandOutput} * @see {@link ChangeMessageVisibilityCommandInput} for command's `input` shape. * @see {@link ChangeMessageVisibilityCommandOutput} for command's `response` shape. * @see {@link SQSClientResolvedConfig | config} for SQSClient's `config` shape. * * @throws {@link InvalidAddress} (client fault) *

The specified ID is invalid.

* * @throws {@link InvalidSecurity} (client fault) *

The request was not made over HTTPS or did not use SigV4 for signing.

* * @throws {@link MessageNotInflight} (client fault) *

The specified message isn't in flight.

* * @throws {@link QueueDoesNotExist} (client fault) *

Ensure that the QueueUrl is correct and that the queue has not been * deleted.

* * @throws {@link ReceiptHandleIsInvalid} (client fault) *

The specified receipt handle isn't valid.

* * @throws {@link RequestThrottled} (client fault) *

The request was denied due to request throttling.

* * * @throws {@link UnsupportedOperation} (client fault) *

Error code 400. Unsupported operation.

* * @throws {@link SQSServiceException} *

Base exception class for all service exceptions from SQS service.

* * * @public */ export declare class ChangeMessageVisibilityCommand extends ChangeMessageVisibilityCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: ChangeMessageVisibilityRequest; output: {}; }; sdk: { input: ChangeMessageVisibilityCommandInput; output: ChangeMessageVisibilityCommandOutput; }; }; }