diff --git a/CHANGELOG.md b/CHANGELOG.md index f8775f9..d6fa2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS enhancement: In-flight message typo fix from 20k to 120k. + ## 2.2.1 ### Changed diff --git a/composer.json b/composer.json index 6ae2ad1..1a70901 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } } } diff --git a/src/Exception/InvalidAddressException.php b/src/Exception/InvalidAddressException.php index 2796781..e0583d0 100644 --- a/src/Exception/InvalidAddressException.php +++ b/src/Exception/InvalidAddressException.php @@ -5,7 +5,7 @@ use AsyncAws\Core\Exception\Http\ClientException; /** - * The `accountId` is invalid. + * The specified ID is invalid. */ final class InvalidAddressException extends ClientException { diff --git a/src/Exception/InvalidSecurityException.php b/src/Exception/InvalidSecurityException.php index 1562fec..6fcea48 100644 --- a/src/Exception/InvalidSecurityException.php +++ b/src/Exception/InvalidSecurityException.php @@ -5,7 +5,7 @@ use AsyncAws\Core\Exception\Http\ClientException; /** - * When the request to a queue is not HTTPS and SigV4. + * The request was not made over HTTPS or did not use SigV4 for signing. */ final class InvalidSecurityException extends ClientException { diff --git a/src/Exception/QueueDoesNotExistException.php b/src/Exception/QueueDoesNotExistException.php index 96d74d9..529e626 100644 --- a/src/Exception/QueueDoesNotExistException.php +++ b/src/Exception/QueueDoesNotExistException.php @@ -5,7 +5,7 @@ use AsyncAws\Core\Exception\Http\ClientException; /** - * The specified queue doesn't exist. + * Ensure that the `QueueUrl` is correct and that the queue has not been deleted. */ final class QueueDoesNotExistException extends ClientException { diff --git a/src/Exception/RequestThrottledException.php b/src/Exception/RequestThrottledException.php index 0db2f62..814347b 100644 --- a/src/Exception/RequestThrottledException.php +++ b/src/Exception/RequestThrottledException.php @@ -7,13 +7,11 @@ /** * The request was denied due to request throttling. * - * - The rate of requests per second exceeds the Amazon Web Services KMS request quota for an account and Region. - * - A burst or sustained high rate of requests to change the state of the same KMS key. This condition is often known - * as a "hot key." - * - Requests for operations on KMS keys in a Amazon Web Services CloudHSM key store might be throttled at a - * lower-than-expected rate when the Amazon Web Services CloudHSM cluster associated with the Amazon Web Services - * CloudHSM key store is processing numerous commands, including those unrelated to the Amazon Web Services CloudHSM - * key store. + * - Exceeds the permitted request rate for the queue or for the recipient of the request. + * - Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see Amazon + * SQS quotas [^1] in the *Amazon SQS Developer Guide*. + * + * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests */ final class RequestThrottledException extends ClientException { diff --git a/src/Exception/TooManyEntriesInBatchRequestException.php b/src/Exception/TooManyEntriesInBatchRequestException.php index d5a8688..6fe2a70 100644 --- a/src/Exception/TooManyEntriesInBatchRequestException.php +++ b/src/Exception/TooManyEntriesInBatchRequestException.php @@ -5,7 +5,13 @@ use AsyncAws\Core\Exception\Http\ClientException; /** - * The batch request contains more entries than permissible. + * The batch request contains more entries than permissible. For Amazon SQS, the maximum number of entries you can + * include in a single SendMessageBatch [^1], DeleteMessageBatch [^2], or ChangeMessageVisibilityBatch [^3] request is + * 10. + * + * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html + * [^2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessageBatch.html + * [^3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibilityBatch.html */ final class TooManyEntriesInBatchRequestException extends ClientException { diff --git a/src/Input/GetQueueUrlRequest.php b/src/Input/GetQueueUrlRequest.php index 1baacf9..714c486 100644 --- a/src/Input/GetQueueUrlRequest.php +++ b/src/Input/GetQueueUrlRequest.php @@ -7,13 +7,14 @@ use AsyncAws\Core\Request; use AsyncAws\Core\Stream\StreamFactory; +/** + * Retrieves the URL of an existing queue based on its name and, optionally, the Amazon Web Services account ID. + */ final class GetQueueUrlRequest extends Input { /** - * The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, - * hyphens (`-`), and underscores (`_`). - * - * Queue URLs and names are case-sensitive. + * (Required) The name of the queue for which you want to fetch the URL. The name can be up to 80 characters long and + * can include alphanumeric characters, hyphens (-), and underscores (_). Queue URLs and names are case-sensitive. * * @required * @@ -22,7 +23,8 @@ final class GetQueueUrlRequest extends Input private $queueName; /** - * The Amazon Web Services account ID of the account that created the queue. + * (Optional) The Amazon Web Services account ID of the account that created the queue. This is only required when you + * are attempting to access a queue owned by another Amazon Web Services account. * * @var string|null */ diff --git a/src/Input/ReceiveMessageRequest.php b/src/Input/ReceiveMessageRequest.php index ae2717f..9f65a9d 100644 --- a/src/Input/ReceiveMessageRequest.php +++ b/src/Input/ReceiveMessageRequest.php @@ -8,6 +8,9 @@ use AsyncAws\Core\Stream\StreamFactory; use AsyncAws\Sqs\Enum\MessageSystemAttributeName; +/** + * Retrieves one or more messages from a specified queue. + */ final class ReceiveMessageRequest extends Input { /** @@ -84,7 +87,27 @@ final class ReceiveMessageRequest extends Input /** * The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being - * retrieved by a `ReceiveMessage` request. + * retrieved by a `ReceiveMessage` request. If not specified, the default visibility timeout for the queue is used, + * which is 30 seconds. + * + * Understanding `VisibilityTimeout`: + * + * - When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of + * the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the + * message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible + * again and can be retrieved by other consumers. + * - Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again + * before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of + * messages if the initial processing fails. + * - You can adjust the visibility timeout using the `--visibility-timeout` parameter in the `receive-message` command + * to match the processing time required by your application. + * - A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires + * counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the + * dead-letter queue. + * + * For more information, see Visibility Timeout [^1] in the *Amazon SQS Developer Guide*. + * + * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html * * @var int|null */ @@ -93,7 +116,8 @@ final class ReceiveMessageRequest extends Input /** * The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a * message is available, the call returns sooner than `WaitTimeSeconds`. If no messages are available and the wait time - * expires, the call does not return a message list. + * expires, the call does not return a message list. If you are using the Java SDK, it returns a + * `ReceiveMessageResponse` object, which has a empty list instead of a Null object. * * ! To avoid HTTP errors, ensure that the HTTP response timeout for `ReceiveMessage` requests is longer than the * ! `WaitTimeSeconds` parameter. For example, with the Java SDK, you can set HTTP transport settings using the diff --git a/src/SqsClient.php b/src/SqsClient.php index aa839f6..284d00e 100644 --- a/src/SqsClient.php +++ b/src/SqsClient.php @@ -157,7 +157,7 @@ public function addPermission($input): Result * 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 [^2]. * - * For FIFO queues, there can be a maximum of 20,000 in flight messages (received from a queue by a consumer, but not + * 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 @@ -268,20 +268,25 @@ public function changeMessageVisibilityBatch($input): ChangeMessageVisibilityBat * * > After you create a queue, you must wait at least one second after the queue is created to be able to use the queue. * - * To get the queue URL, use the `GetQueueUrl` action. `GetQueueUrl` requires only the `QueueName` parameter. be aware - * of existing queue names: + * To retrieve the URL of a queue, use the `GetQueueUrl` [^3] action. This action only requires the `QueueName` [^4] + * parameter. * - * - If you provide the name of an existing queue along with the exact names and values of all the queue's attributes, - * `CreateQueue` returns the queue URL for the existing queue. - * - If the queue name, attribute names, or attribute values don't match an existing queue, `CreateQueue` returns an - * error. + * When creating queues, keep the following points in mind: + * + * - If you specify the name of an existing queue and provide the exact same names and values for all its attributes, + * the `CreateQueue` [^5] action will return the URL of the existing queue instead of creating a new one. + * - If you attempt to create a queue with a name that already exists but with different attribute names or values, the + * `CreateQueue` action will return an error. This ensures that existing queues are not inadvertently altered. * * > Cross-account permissions don't apply to this action. For more information, see Grant cross-account permissions to - * > a role and a username [^3] in the *Amazon SQS Developer Guide*. + * > a role and a username [^6] in the *Amazon SQS Developer Guide*. * * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving * [^2]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html - * [^3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name + * [^3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueUrl.html + * [^4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html#API_CreateQueue_RequestSyntax + * [^5]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html + * [^6]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name * * @see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#createqueue @@ -325,10 +330,11 @@ public function createQueue($input): CreateQueueResult * a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS * automatically deletes messages left in a queue longer than the retention period configured for the queue. * - * > The `ReceiptHandle` is associated with a *specific instance* of receiving a message. If you receive a message more - * > than once, the `ReceiptHandle` is different each time you receive a message. When you use the `DeleteMessage` - * > action, you must provide the most recently received `ReceiptHandle` for the message (otherwise, the request - * > succeeds, but the message will not be deleted). + * > Each time you receive a message, meaning when a consumer retrieves a message from the queue, it comes with a unique + * > `ReceiptHandle`. If you receive the same message more than once, you will get a different `ReceiptHandle` each + * > time. When you want to delete a message using the `DeleteMessage` action, you must use the `ReceiptHandle` from the + * > most recent time you received the message. If you use an old `ReceiptHandle`, the request will succeed, but the + * > message might not be deleted. * > * > For standard queues, it is possible to receive a message even after you delete it. This might happen on rare * > occasions if one of the servers which stores a copy of the message is unavailable when you send the request to @@ -499,12 +505,13 @@ public function getQueueAttributes($input): GetQueueAttributesResult } /** - * Returns the URL of an existing Amazon SQS queue. + * The `GetQueueUrl` API returns the URL of an existing Amazon SQS queue. This is useful when you know the queue's name + * but need to retrieve its URL for further operations. * - * To access a queue that belongs to another AWS account, use the `QueueOwnerAWSAccountId` parameter to specify the - * account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more - * information about shared queue access, see `AddPermission` or see Allow Developers to Write Messages to a Shared - * Queue [^1] in the *Amazon SQS Developer Guide*. + * To access a queue owned by another Amazon Web Services account, use the `QueueOwnerAWSAccountId` parameter to specify + * the account ID of the queue's owner. Note that the queue owner must grant you the necessary permissions to access the + * queue. For more information about accessing shared queues, see the `AddPermission` API or Allow developers to write + * messages to a shared queue [^1] in the *Amazon SQS Developer Guide*. * * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue * @@ -650,8 +657,8 @@ public function queueExists($input): QueueExistsWaiter * long-poll support. For more information, see Amazon SQS Long Polling [^1] in the *Amazon SQS Developer Guide*. * * Short poll is the default behavior where a weighted random set of machines is sampled on a `ReceiveMessage` call. - * Thus, only the messages on the sampled machines are returned. If the number of messages in the queue is small (fewer - * than 1,000), you most likely get fewer messages than you requested per `ReceiveMessage` call. If the number of + * Therefore, only the messages on the sampled machines are returned. If the number of messages in the queue is small + * (fewer than 1,000), you most likely get fewer messages than you requested per `ReceiveMessage` call. If the number of * messages in the queue is extremely small, you might not receive any messages in a particular `ReceiveMessage` * response. If this happens, repeat the request. * @@ -669,12 +676,7 @@ public function queueExists($input): QueueExistsWaiter * * You can provide the `VisibilityTimeout` parameter in your request. The parameter is applied to the messages that * Amazon SQS returns in the response. If you don't include the parameter, the overall visibility timeout for the queue - * is used for the returned messages. For more information, see Visibility Timeout [^4] in the *Amazon SQS Developer - * Guide*. - * - * A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires - * counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter - * queue. + * is used for the returned messages. The default visibility timeout for a queue is 30 seconds. * * > In the future, new attributes might be added. If you write code that calls this action, we recommend that you * > structure your code so that it can handle new attributes gracefully. @@ -682,7 +684,6 @@ public function queueExists($input): QueueExistsWaiter * [^1]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html * [^2]: https://www.ietf.org/rfc/rfc1321.txt * [^3]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html - * [^4]: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html * * @see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#receivemessage