async-aws/sqs
AsyncAWS SQS client for PHP: a lightweight, non-blocking way to send, receive, and manage Amazon SQS messages without the full AWS SDK. Ideal for async apps and microservices, with typed requests/responses and modern PHP support.
queue:work) or serve as a dedicated SQS client for hybrid architectures.sqs in .env), though this would require custom implementation.serialize() or JSON) may need alignment for complex objects.QueueException).Aws\Sqs\SqsClient mocks) adds overhead compared to Laravel’s queue mocks.ApproximateNumberOfMessages) be integrated into Laravel’s monitoring (e.g., Laravel Horizon, Datadog)?Illuminate\Queue\QueueManager to support SQS as a driver (custom SqsConnector).dispatch() with a custom SQS queue driver.aws/aws-sdk-php (v3+). Ensure the package’s SDK version aligns with Laravel’s dependencies.serialize() may need custom handling for complex objects (e.g., relationships, closures).Illuminate\Contracts\Queue\ShouldQueue interface with custom handle() methods for SQS-specific logic.$this->app->bind('sqs', function () {
return new Aws\Sqs\SqsClient([
'region' => env('AWS_REGION'),
'version' => 'latest',
]);
});
use AsyncAws\Sqs\SqsClient;
$sqs = app(SqsClient::class);
$sqs->sendMessage([
'QueueUrl' => env('SQS_QUEUE_URL'),
'MessageBody' => json_encode(['job' => 'SendEmailJob']),
]);
queue:work) with an SQS driver or a custom consumer (e.g., AWS Lambda).async-aws/sqs and aws/aws-sdk-php for updates. Pin versions in composer.json to avoid breaking changes..env or AWS Parameter Store.AWS\Sqs\Exception\SqsException) and their Laravel mappings.storage/logs/laravel.log).try {
$sqs->sendMessage(...);
} catch (Aws\Sqs\Exception\SqsException $e) {
report(new SqsException($e));
throw new \RuntimeException('Failed to send SQS message', 0, $e);
}
ReceiveMessage calls to optimize throughput.ApproximateNumberOfMessages and scale consumers (e.g., Lambda concurrency) accordingly.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| SQS Unavailable (AWS Outage) | Jobs undelivered | Fallback to database queue or local queue; implement retry logic. |
| Throttling (TooManyRequests) | Job processing delays | Exponential backoff in Laravel’s queue worker; monitor ThrottledExceptions. |
| Permission Denied (IAM) | Jobs fail silently |
How can I help you explore Laravel packages today?