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

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

clicksandmortar/laravel-sqs-sns-subscription-queue
==================================================

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

v2.7.0(1y ago)016.7kMITPHPPHP &gt;=7.1.3

Since Aug 29Pushed 1y agoCompare

[ Source](https://github.com/clicksandmortar/laravel-sqs-sns-subscription-queue)[ Packagist](https://packagist.org/packages/clicksandmortar/laravel-sqs-sns-subscription-queue)[ RSS](/packages/clicksandmortar-laravel-sqs-sns-subscription-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (31)Used By (0)

AWS SQS SNS Subscription Queue
==============================

[](#aws-sqs-sns-subscription-queue)

[![Downloads](https://camo.githubusercontent.com/bd005a53cc7a888f271dc08833ef1d78a1f4433dfcfff9d1b42288b7cb2d61f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f626c6f63616c2f6c61726176656c2d7371732d736e732d737562736372697074696f6e2d71756575652e737667)](https://packagist.org/packages/joblocal/laravel-sqs-sns-subscription-queue)[![Version](https://camo.githubusercontent.com/80641e7f0b58b411b933e28ba883e1a57cf74c75ca29c364acc4e646cb59310d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f626c6f63616c2f6c61726176656c2d7371732d736e732d737562736372697074696f6e2d71756575652e737667)](https://packagist.org/packages/joblocal/laravel-sqs-sns-subscription-queue)

A simple extension to the [Illuminate/Queue](https://github.com/illuminate/queue) queue system used in [Laravel](https://laravel.com) and [Lumen](https://lumen.laravel.com/).

Using this connector allows [SQS](https://aws.amazon.com/sqs/) messages originating from a [SNS](https://aws.amazon.com/sns/) subscription to be worked on with Illuminate\\Queue\\Jobs\\SqsJob.

This is especially useful in a miroservice architecture where multiple services subscribe to a common topic with their queues.

Understand that this package will not handle publishing to SNS, please use the [AWS SDK](https://aws.amazon.com/sdk-for-php/) to publish an event to SNS.

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

[](#requirements)

- Laravel (tested with version 5.8)
- or Lumen (tested with version 5.8)

Usage
-----

[](#usage)

Add the LaravelSqsSnsSubscriptionQueue ServiceProvider to your application.

### Laravel

[](#laravel)

[Registering Service Providers in Laravel](https://laravel.com/docs/5.6/providers#registering-providers)

```
'providers' => [
    // ...
    Joblocal\LaravelSqsSnsSubscriptionQueue\SqsSnsServiceProvider::class,
],
```

### Lumen

[](#lumen)

[Registering Service Providers in Lumen](https://lumen.laravel.com/docs/5.6/providers#registering-providers)

```
$app->register(Joblocal\LaravelSqsSnsSubscriptionQueue\SqsSnsServiceProvider::class);
```

### Configuration

[](#configuration)

You'll need to configure the queue connection in your config/queue.php

```
'connections' => [
  'sqs-sns' => [
    'driver' => 'sqs-sns',
    'key'    => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'queue'  => env('SQS_QUEUE', 'your-queue-url'),
    'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    'routes' => [
        // you can use the "Subject" field
        'Subject' => 'App\\Jobs\\YourJob',
        // or the "TopicArn" of your SQS message
        'TopicArn:123' => 'App\\Jobs\\YourJob',
        // to specify which job class should handle the job
    ],
  ],
],
```

Once the sqs-sns queue connector is configured you can start using it by setting queue driver to 'sqs-sns' in your .env file.

### Job class example

[](#job-class-example)

```
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

/**
 * Example Job class
 */
class Job implements ShouldQueue
{
  use InteractsWithQueue, Queueable, SerializesModels;

  /**
   * @param string  $subject   SNS Subject
   * @param array   $payload   JSON decoded 'Message'
   */
  public function __construct(string $subject, array $payload)
  {
  }
}
```

Message transformation
----------------------

[](#message-transformation)

When SNS publishes to SQS queues the received message signature is as follows:

```
{
  "Type" : "Notification",
  "MessageId" : "63a3f6b6-d533-4a47-aef9-fcf5cf758c76",
  "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic",
  "Subject" : "Testing publish to subscribed queues",
  "Message" : "Hello world!",
  "Timestamp" : "2017-03-29T05:12:16.901Z",
  "SignatureVersion" : "1",
  "Signature" : "...",
  "SigningCertURL" : "...",
  "UnsubscribeURL" : "..."
}
```

Illuminate\\Queue\\Jobs\\SqsJob requires the following signature:

```
{
  "job": "Illuminate\\Queue\\CallQueuedHandler@call",
  "data": {
    "commandName": "App\\Jobs\\YourJob",
    "command": "...",
  }
}
```

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

[](#installation)

The best way to install laravel-sqs-sns-subscription is by using [Composer](http://getcomposer.org/).

To install the most recent version:

```
php composer.phar require joblocal/laravel-sqs-sns-subscription-queue
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~158 days

Recently: every ~274 days

Total

20

Last Release

533d ago

Major Versions

v1.0 → v2.02017-06-20

PHP version history (2 changes)v1.0PHP &gt;=5.6.4

v2.3PHP &gt;=7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e4c1c87433d633a651085f46a48357060e17265a559ee8e88b1905dd991d9b3?d=identicon)[majorasjack](/maintainers/majorasjack)

---

Top Contributors

[![jayhof](https://avatars.githubusercontent.com/u/15269648?v=4)](https://github.com/jayhof "jayhof (26 commits)")[![juliusliebert](https://avatars.githubusercontent.com/u/15218150?v=4)](https://github.com/juliusliebert "juliusliebert (11 commits)")[![vixone](https://avatars.githubusercontent.com/u/11368133?v=4)](https://github.com/vixone "vixone (6 commits)")[![vyuldashev](https://avatars.githubusercontent.com/u/1809081?v=4)](https://github.com/vyuldashev "vyuldashev (4 commits)")[![TijmenWierenga](https://avatars.githubusercontent.com/u/8513032?v=4)](https://github.com/TijmenWierenga "TijmenWierenga (3 commits)")[![MajorasJack](https://avatars.githubusercontent.com/u/6554421?v=4)](https://github.com/MajorasJack "MajorasJack (2 commits)")[![BertvanHoekelen](https://avatars.githubusercontent.com/u/7521173?v=4)](https://github.com/BertvanHoekelen "BertvanHoekelen (2 commits)")[![huubvdw](https://avatars.githubusercontent.com/u/11613086?v=4)](https://github.com/huubvdw "huubvdw (2 commits)")[![tim-steinberg](https://avatars.githubusercontent.com/u/19708575?v=4)](https://github.com/tim-steinberg "tim-steinberg (2 commits)")[![nnnnathann](https://avatars.githubusercontent.com/u/61154?v=4)](https://github.com/nnnnathann "nnnnathann (1 commits)")[![oldandgrey](https://avatars.githubusercontent.com/u/8322347?v=4)](https://github.com/oldandgrey "oldandgrey (1 commits)")[![SelimSalihovic](https://avatars.githubusercontent.com/u/3939551?v=4)](https://github.com/SelimSalihovic "SelimSalihovic (1 commits)")[![tadhanfivejack](https://avatars.githubusercontent.com/u/29368386?v=4)](https://github.com/tadhanfivejack "tadhanfivejack (1 commits)")[![djravine](https://avatars.githubusercontent.com/u/155802?v=4)](https://github.com/djravine "djravine (1 commits)")[![DanielGSoftware](https://avatars.githubusercontent.com/u/49187378?v=4)](https://github.com/DanielGSoftware "DanielGSoftware (1 commits)")[![devinpitcher](https://avatars.githubusercontent.com/u/489912?v=4)](https://github.com/devinpitcher "devinpitcher (1 commits)")[![AdenFraser](https://avatars.githubusercontent.com/u/1902819?v=4)](https://github.com/AdenFraser "AdenFraser (1 commits)")

---

Tags

laravelawslumenqueuesqsSNSsns subscription

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[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)[shiftonelabs/laravel-sqs-fifo-queue

Adds a Laravel queue driver for Amazon SQS FIFO queues.

1556.0M3](/packages/shiftonelabs-laravel-sqs-fifo-queue)[dusterio/laravel-aws-worker

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

3105.7M](/packages/dusterio-laravel-aws-worker)[dusterio/laravel-plain-sqs

Custom SQS connector for Laravel that supports custom format JSON

1352.7M1](/packages/dusterio-laravel-plain-sqs)[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)
