PHPackages                             budiardianata/plain-sqs-driver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. budiardianata/plain-sqs-driver

ActiveLibrary[Queues &amp; Workers](/categories/queues)

budiardianata/plain-sqs-driver
==============================

Laravel package to handle plain SQS queue.

v1.0.0(2w ago)110MITPHPPHP &gt;=8.3CI passing

Since May 23Pushed 2w agoCompare

[ Source](https://github.com/budiardianata/plain-sqs-driver)[ Packagist](https://packagist.org/packages/budiardianata/plain-sqs-driver)[ Docs](https://github.com/budiardianata/plain-sqs-driver)[ GitHub Sponsors](https://github.com/budiardianata)[ RSS](/packages/budiardianata-plain-sqs-driver/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (0)

Plain SQS Driver for Laravel
============================

[](#plain-sqs-driver-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e8d84278a3782c748f63379367f24ec605995fd1950613da3831e41425486055/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6275646961726469616e6174612f706c61696e2d7371732d6472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/budiardianata/plain-sqs-driver)[![Total Downloads](https://camo.githubusercontent.com/fdfb7fea49c87c81cca826dd9715db15212fd242df0abdcea1255aeadc2d567c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6275646961726469616e6174612f706c61696e2d7371732d6472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/budiardianata/plain-sqs-driver)

`budiardianata/plain-sqs-driver` is a Laravel queue driver wrapper for consuming and dispatching **plain JSON SQS messages**.

This is useful when messages are produced outside Laravel (for example AWS S3 Event Notifications, EventBridge, or another service) but still need to be processed by Laravel queue workers.

What this package does
----------------------

[](#what-this-package-does)

- Registers a custom queue driver: `sqs-plain`
- Transforms raw/plain SQS message bodies into Laravel queue payload format
- Routes messages to your handler class based on queue name
- Supports dispatching either Laravel-style payloads or plain payloads
- Implement in-memory message buffer to prefetch up to 10 messages per SQS API call.

Installation
------------

[](#installation)

```
composer require budiardianata/plain-sqs-driver
```

Publish package config:

```
php artisan vendor:publish --tag="plain-sqs-driver-config"
```

Configuration
-------------

[](#configuration)

Add a queue connection in `config/queue.php`:

```
'connections' => [
    'sqs_plain' => [
        'driver' => 'sqs-plain',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'prefix' => env('SQS_PREFIX', 'https://sqs.ap-southeast-1.amazonaws.com/your-account-id'),
        'queue' => env('SQS_QUEUE', 'your-queue-name'),
        'region' => env('AWS_DEFAULT_REGION', 'ap-southeast-1'),
    ],
],
```

Configure handlers in `config/plain-sqs.php`:

```
return [
    /**
     * Specifies the number of seconds that the SQS connection stays open waiting for a message to arrive if the queue is currently empty.
     */
    'wait_time_seconds' => 20,

    /**
     * Specifies the absolute maximum number of messages you want SQS to return in a single ReceiveMessage call.
     */
    'max_number_of_messages' => 1,

    'handlers' => [
        /**
         * Do not delete the 'default' handler key, only change the class with your own implementation
         */
        'default' => DefaultPlainSqsHandler::class,

        // 'plain-sqs' => App\Jobs\S3NotificationHandler::class,
    ],
];
```

- `wait_time_seconds`: SQS long-poll time (1-20).
- `max_number_of_messages`: batch prefetch size per receive call (1-10). Use `> 1` to let one worker load multiple messages in memory and process them one-by-one.

Create your handler class and implement package interface `PlainSqsHandler`:

```
