--- title: "Amazon SQS driver" description: "The babelqueue-sqs drop-in driver — a polyglot Amazon SQS queue on Laravel's native sqs connection. Polyglot jobs are sent as the canonical envelope with the §3 MessageAttributes; standard Laravel jobs pass straight through." source: https://babelqueue.com/docs/laravel/1.x/amazon-sqs/ updated: 2026-06-13T00:00:00.000Z --- # Amazon SQS driver `babelqueue-sqs` is a **drop-in queue connection** that makes an Amazon SQS queue polyglot. It extends Laravel's native `sqs` driver: jobs that opt into BabelQueue are sent as the [canonical envelope](/docs/spec/1.x/envelope/) with the [§3 SQS `MessageAttributes`](/docs/spec/1.x/broker-bindings/#amazon-sqs), so a Go, Python, Node, Java or .NET worker can route and trace them — while **standard Laravel jobs on the same connection pass straight through unchanged**. ## Requirements The AWS SDK for PHP is required (Laravel lists it as a suggestion): ```bash composer require aws/aws-sdk-php ``` ## Configuration Add a connection in `config/queue.php` with `driver` set to `babelqueue-sqs`. The config keys are exactly Laravel's stock `sqs` keys: ```php 'connections' => [ 'babelqueue-sqs' => [ 'driver' => 'babelqueue-sqs', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.eu-central-1.amazonaws.com/your-account-id'), 'queue' => env('SQS_QUEUE', 'orders'), 'suffix' => env('SQS_SUFFIX', ''), 'region' => env('AWS_DEFAULT_REGION', 'eu-central-1'), ], ], ``` The connector mirrors the stock `SqsConnector` (credentials, prefix/suffix), so anything that works for `sqs` works here. For LocalStack/ElasticMQ, set an `endpoint` key as you would for the native driver. ## Produce Producing is identical to the other BabelQueue drivers — see [Producing messages](/docs/laravel/1.x/producing-messages/). Dispatch a typed `ShouldQueuePolyglot` job (or use the `BabelQueue` facade) onto the connection: ```php use BabelQueue\Facades\BabelQueue; BabelQueue::connection('babelqueue-sqs') ->publish('urn:babel:orders:created', ['order_id' => 1042]); ``` The job is sent as the canonical envelope (`MessageBody`) with the projected `MessageAttributes` (`bq-job`/`bq-trace-id`/`bq-message-id`/`bq-schema-version`/ `bq-source-lang`/`bq-created-at`). A plain Laravel job dispatched to the same connection is encoded the normal Laravel way — no envelope, no attributes — so existing workers keep working. ## Consume Run a worker against the connection as usual: ```bash php artisan queue:work babelqueue-sqs ``` Polyglot messages — including those produced by **another language's SDK** — are decoded, routed by URN through the dispatcher and handled; standard jobs run as normal. See [Consuming messages](/docs/laravel/1.x/consuming-messages/) for handler registration. > **`attempts` note.** As a Laravel driver, the reserved job surfaces the broker's > **native** receive count via `SqsJob::attempts()` (i.e. `ApproximateReceiveCount`). > This is the documented, exempt divergence from the framework-less SDKs, which reconcile > `attempts` to `ApproximateReceiveCount − 1` — see the > [SQS binding](/docs/spec/1.x/broker-bindings/#amazon-sqs). Because the wire format is the canonical envelope, a message your Laravel app consumes may have been produced by any BabelQueue SDK, and vice-versa.