PHPackages                             kristianedlund/laravel-external-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. kristianedlund/laravel-external-queue

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

kristianedlund/laravel-external-queue
=====================================

Use Laravel queues for sending messages between distributed systems

v1.1(10y ago)91055[1 PRs](https://github.com/kristianedlund/laravel-external-queue/pulls)MITPHPPHP &gt;=5.4.0

Since Apr 2Pushed 7y ago1 watchersCompare

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

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

Laravel External Queues
=======================

[](#laravel-external-queues)

Laravel queues are an awesome thing to use internally in an application in order to manage asynchronous tasks. However, in the usecase where you want external components such as desktop applications or other web applications to communicate with Laravel through queues it becomes somewhat more messy, since there is quite a bit of information embedded in a queue message about the internal workings, such as class names.

This package is an attempt to let applications communicate through queues by using a string as the job name, and then letting the internals of Laravel translate handle the execution.

If you don't need to send queue messages outside of your laravel application, then you don't need this package. The default works excellent.

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

[](#installation)

Pull this package in through Composer.

```
{
    "require": {
        "kristianedlund/laravel-external-queue": "1.0"
    }
}
```

```
$ composer update

```

Add the package to your application service providers in `config/app.php`

```
'providers' => [

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...

    'Kristianedlund\LaravelExternalQueue\ExternalQueueServiceProvider',

],
```

Publish the package config file to your application.

```
$ php artisan vendor:publish

```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

First of all you set up an external queue in the normal queue config file in laravel. It should look like

```
'externalsqs' => [
    'driver' => 'externalsqs',
    'key'    => 'your-public-key',
    'secret' => 'your-secret-key',
    'queue'  => 'your-queue-url',
    'region' => 'us-east-1',
],
```

Second part is that you set up the different job names and map them to handler classes in the "externalqueue" config file.

### Handler files

[](#handler-files)

Last but not least you need to write the handler files.

They need to implement the handler contract `Kristianedlund\LaravelExternalQueue\Contracts\ExternalQueueJobHandler` and could look like

```
