PHPackages                             maxgaurav/laravel-sns-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. maxgaurav/laravel-sns-sqs-queue

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

maxgaurav/laravel-sns-sqs-queue
===============================

Sns Messages as queues using extended laravel sqs driver.

v1.1.0(6y ago)43.8k2MITPHPPHP ^7.2

Since Dec 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/maxgaurav/laravel-sns-sqs-queue)[ Packagist](https://packagist.org/packages/maxgaurav/laravel-sns-sqs-queue)[ Docs](https://github.com/maxgaurav/laravel-sqs-sns)[ RSS](/packages/maxgaurav-laravel-sns-sqs-queue/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Process SNS Messages as SQS Jobs
================================

[](#process-sns-messages-as-sqs-jobs)

This package allows you to process sns messages posted on various topics subscribed by an SQS to be processed as a job.

The queue also processes standard jobs pushed via laravel.

This package is a great use cases for applications beings deployed to microservices.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- Laravel 6
- SQS driver for laravel
- SQS in AWS
- SNS in AWS

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

[](#installation)

Install using composer

```
composer require maxgaurav/laravel-sns-sqs-queue
```

The package will automatically register its service provider.

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

[](#configuration)

In **queue.php** add the following driver setup

```
return [
    //...

    'sqs' => [
        'driver' => 'sqs',
        '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', 'your-queue-name'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
     ],

    'sns-sqs' => [
        'driver' => 'sns-sqs',
        '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', 'your-queue-name'),
        'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
        'sns-config' => [
            'topics' => [
                'topicName' => \App\Jobs\YourJob::class,
                'topic2Name' => \App\Jobs\YourOtherJob::class
                //...
            ],
            'default-job' => '', // if you want to override the default job executed for non matching topics
            'prefix' => env('SNS_PREFIX', 'arn:aws:sns:us-east-2:123345666:'), // SNS Topic Prefix (must include the last colon)
        ],
    ],
```

Prerequisites
-------------

[](#prerequisites)

- First setup your SQS queue in AWS
- The SQS must be subscribed to all the topics of SNS you want to process through your job.

Usage
-----

[](#usage)

Each job created must have two constructor inputs. First input is for the topic name the job is executing for and second is the array of json decoded data sent in the message.

```
class SampleJob {

    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * @var string
     */
    public $topic;

    /**
     * @var array
     */
    public $body;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($topic, $body)
    {
        $this->topic = $topic;
        $this->body = $body;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        // do your handling
    }

}
```

Default Job
-----------

[](#default-job)

The package uses a default job instance **\\MaxGaurav\\LaravelSnsSqsQueue\\DefaultJob** for topics not mapped in the configuration. The job has a default functionality to fail for such topics. This is done to allow the application to tell that topics are not mapped.

The DefaultJob class can be replaced with a custom default job handler using key **default-job**. Pass your class instance and it would be used instead.

Normal Jobs
-----------

[](#normal-jobs)

The package can also be used to push normal jobs to SQS queue as done using sqs driver. The queue would check if the job is a sns job then would map to topic name and would call the mapped jobs otherwise would fallback to default SQS driver behavior.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~44 days

Total

3

Last Release

2245d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a63733a2e778c3eba1701a6c9f4907459127536e788f42baba472fdeb9af34e?d=identicon)[maxgaurav](/maintainers/maxgaurav)

---

Top Contributors

[![maxgaurav](https://avatars.githubusercontent.com/u/10531584?v=4)](https://github.com/maxgaurav "maxgaurav (13 commits)")

---

Tags

laravelawsqueuesqsSNSsns-sqs

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/maxgaurav-laravel-sns-sqs-queue/health.svg)](https://phpackages.com/packages/maxgaurav-laravel-sns-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)[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)
