PHPackages                             atymic/laravel-bulk-sqs-queue - 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. atymic/laravel-bulk-sqs-queue

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

atymic/laravel-bulk-sqs-queue
=============================

Laravel SQS Bulk Queue

0.6.0(6mo ago)15184.3k↑15.7%5MITPHPPHP ^8.1CI passing

Since Jun 18Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/atymic/laravel-bulk-sqs-queue)[ Packagist](https://packagist.org/packages/atymic/laravel-bulk-sqs-queue)[ Docs](https://github.com/atymic/laravel-bulk-sqs-queue)[ GitHub Sponsors](https://github.com/atymic)[ RSS](/packages/atymic-laravel-bulk-sqs-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (11)Used By (0)

Laravel SQS Bulk Queue
======================

[](#laravel-sqs-bulk-queue)

[![Latest Version on Packagist](https://camo.githubusercontent.com/96882516d2c3ba025364c9536a4b557b120d0215e4364f0fdc02a8ff63a9b59b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6174796d69632f6c61726176656c2d62756c6b2d7371732d71756575652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/atymic/laravel-bulk-sqs-queue)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e190143b481c8a074e39795eb764284ad1de9abc019e323dc7016d5a282ab807/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6174796d69632f6c61726176656c2d62756c6b2d7371732d71756575652f72756e2d74657374732e796d6c3f6c6162656c3d7465737473266272616e63683d6d6173746572)](https://github.com/atymic/laravel-bulk-sqs-queue/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/29af54faeadab6ffce186eecfaae0ed159af41d45fe36f35bf0ecbc464e5f1b6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6174796d69632f6c61726176656c2d62756c6b2d7371732d71756575652f7068702d63732d66697865722e796d6c3f6c6162656c3d636f64652532307374796c65266272616e63683d6d6173746572)](https://github.com/atymic/laravel-bulk-sqs-queue/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/32040a4ecb45d7447af4e8a1fe0bea9f3c151b773be5ffe0199a68927258598e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6174796d69632f6c61726176656c2d62756c6b2d7371732d71756575652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/atymic/laravel-bulk-sqs-queue)

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

[](#installation)

You can install the package via composer:

```
composer require atymic/laravel-bulk-sqs-queue
```

How it works
------------

[](#how-it-works)

By default, Laravel allows you to easily execute a batch of jobs with `Queue::bulk()` method or with built-in [job batching](https://laravel.com/docs/master/queues#job-batching). Both methods accept an array of jobs for dispatch and loop over every job, making one HTTP request for each job.

This isn't an issue when you are dispatching a few jobs, but there's two major issues with bigger batches:

- Waiting for 1000 http requests (even SQS, with 20-50ms latency) is two to five seconds, that's slow!
- SQS is billed per request, and they support batching of up to 10 messages for the same cost as a single `sendMessage` call. That's a 10x cost saving!

But AWS SQS has a [batch action](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-batch-api-actions.html) that let you group up to 10 messages with a single request, in order to reduce costs. Under the hood, this package override the bulk method to:

- Batch jobs into 10 per request, or 200kb chunks (SQS has a maximum of 256kb, including request overhead/etc)
- Dispatch those batches asynchronously, up to `$concurrency` at a time (default 5)

That's about it. With this package, the laravel queue system should work the exact same as normal. You should have the same result in your application and your AWS SQS dashboard but with a smaller AWS bill :)

Usage
-----

[](#usage)

This package provides a queue connector called `sqs-bulk`. Inside your `queue.php` config file, add it to `connections`:

```
'connections' => [
        'sqs-bulk' => [
            'driver'       => 'sqs-bulk',
            'key'          => env('AWS_ACCESS_KEY_ID'),
            'secret'       => env('AWS_SECRET_ACCESS_KEY'),
            'prefix'       => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
            'queue'        => env('SQS_QUEUE', 'default'),
            'suffix'       => env('SQS_SUFFIX'),
            'region'       => env('AWS_DEFAULT_REGION', 'us-east-1'),
            'after_commit' => false,
            'concurrency'  => 5, // Set the request concurrency, defaults to 5
        ],
]
```

Then you can start a queue worker for the new "connection" and the given queue ('default' queue can be override with `SQS_QUEUE`):

```
php artisan queue:work sqs-bulk --queue=default
```

It will process new jobs as they are pushed onto the queue. You can group jobs with queue's bulk method:

```
Illuminate\Support\Facades\Queue::bulk([
    new \App\Jobs\Foo,
    new \App\Jobs\Bar,
    new \App\Jobs\Baz,
], '', 'default');
```

or with laravel's built-in [job batching](https://laravel.com/docs/master/queues#job-batching) feature:

```
Illuminate\Support\Facades\Bus::batch([
    new \App\Jobs\Foo,
    new \App\Jobs\Bar,
    new \App\Jobs\Baz,
])->name('My sqs batch')->onQueue('default')->dispatch();
```

It should have processed the 3 jobs by creating 3 "messages" on AWS SQS but with only 1 request.

### Failing jobs

[](#failing-jobs)

This package only affect the way jobs are transmitted to AWS SQS. Once received by AWS SQS, they are handled as separate messages. From AWS SQS perspective, there is no relation between messages. The batch request can result in a combination of successful and unsuccessful actions that doesn't affect each others.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [atymic](https://github.com/atymic)
- [Laravel-BatchSQS](https://github.com/CoInvestor/Laravel-BatchSQS)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance65

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~264 days

Recently: every ~320 days

Total

7

Last Release

209d ago

PHP version history (3 changes)0.1.0PHP ^7.4 || ^8.0

0.3.0PHP ^8.0

0.4.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/65eb3a7ba2a2c13b3a9de48b836caf759ad4052f9a839e30464c80d177d5b3d2?d=identicon)[atymic](/maintainers/atymic)

---

Top Contributors

[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (11 commits)")[![bachilli](https://avatars.githubusercontent.com/u/1070049?v=4)](https://github.com/bachilli "bachilli (1 commits)")[![buddhaCode](https://avatars.githubusercontent.com/u/11678100?v=4)](https://github.com/buddhaCode "buddhaCode (1 commits)")[![jryd](https://avatars.githubusercontent.com/u/13251203?v=4)](https://github.com/jryd "jryd (1 commits)")[![smknstd](https://avatars.githubusercontent.com/u/2412608?v=4)](https://github.com/smknstd "smknstd (1 commits)")

---

Tags

laravelqueuesqsatymiclaravel-bulk-sqs-queue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/atymic-laravel-bulk-sqs-queue/health.svg)

```
[![Health](https://phpackages.com/badges/atymic-laravel-bulk-sqs-queue/health.svg)](https://phpackages.com/packages/atymic-laravel-bulk-sqs-queue)
```

###  Alternatives

[shiftonelabs/laravel-sqs-fifo-queue

Adds a Laravel queue driver for Amazon SQS FIFO queues.

1556.0M3](/packages/shiftonelabs-laravel-sqs-fifo-queue)[joblocal/laravel-sqs-sns-subscription-queue

A simple Laravel service provider which adds a new queue connector to handle SNS subscription queues.

48416.3k](/packages/joblocal-laravel-sqs-sns-subscription-queue)[maqe/laravel-sqs-fifo

Laravel package that enables support for SQS FIFO Queue

15137.2k](/packages/maqe-laravel-sqs-fifo)[pod-point/laravel-aws-pubsub

A Laravel broadcasting driver and queue driver that broadcasts and listens to published events utilising AWS SNS, EventBridge and SQS.

1096.1k](/packages/pod-point-laravel-aws-pubsub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
