PHPackages                             kotalawala/laravel-stomp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kotalawala/laravel-stomp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kotalawala/laravel-stomp
========================

Laravel Stomp driver

01PHP

Since Aug 22Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://github.com/asseco-voice/art/raw/main/evil_logo.png)](https://see.asseco.com)

Laravel Stomp driver
====================

[](#laravel-stomp-driver)

This package enables usage of Stomp driver for queueing natively inside Laravel.

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

[](#installation)

Package is installed through composer and is automatically registered as a Laravel service provider.

`composer require asseco-voice/laravel-stomp`

In order to connect it to your queue you need to change queue connection driver in `.env` file:

```
QUEUE_CONNECTION=stomp

```

Connection variables:

```
STOMP_PROTOCOL      protocol (defaults to TCP)
STOMP_HOST          broker host (defaults to 127.0.0.1)
STOMP_PORT          port where STOMP is exposed in your broker (defaults to 61613)
STOMP_USERNAME      broker username (defaults to admin)
STOMP_PASSWORD      broker password (defaults to admin)

```

You can subscribe to queues to read from or to write to with:

```
STOMP_READ_QUEUES=...
STOMP_WRITE_QUEUES=...

```

Both have same nomenclature when it comes to subscribing:

```
topic                         [
            'connection' => 'stomp',
            'queue' => [env('STOMP_READ_QUEUES', 'default')],
            ...
        ],
    ],

    'local' => [
        'supervisor-1' => [
            'connection' => 'stomp',
            'queue' => [env('STOMP_READ_QUEUES', 'default')],
            ...
        ],
    ],
],

```

If you need a custom configuration, publish Horizon config (check Horizon documentation) and adapt to your needs.

Non-Laravel events
------------------

[](#non-laravel-events)

It is possible to handle outside events as well. By default, if event is not a standard Laravel event it gets re-thrown as a `stomp.*` event with payload it received.

If the frame you received belongs to a `topic::test_queue` queue, system will throw a `stomp.topic.test_queue` event, otherwise if for some reason the queue name can't be parsed it will dispatch a `stomp.event` event.

You can listen to it by including this in `EventServiceProvider::boot()`:

```
Event::listen('stomp.*', function ($event, $payload) {
    ...
});

```

Failed jobs
-----------

[](#failed-jobs)

For the sake of simplicity and brevity `StompJob` class is defined in a way to utilize Laravel tries and backoff properties out of the box ([official documentation](https://laravel.com/docs/8.x/queues#dealing-with-failed-jobs)).

Upon failure, jobs will retry 5 times before being written to `failed_jobs` table.

Each subsequent attempt will be tried in `attempt^2` seconds, meaning if it is a third attempt, it will retry in 9s after the previous job failure.

Note that **job properties by default have precedence over CLI commands**, thus with these defaults in place the flags `--tries` and `--backoff` will be overridden.

You can turn off this behavior with following `env` variables:

- `STOMP_AUTO_TRIES` - defaults to `true`. Set to `false` to revert to Laravel default of `0` retries.
- `STOMP_AUTO_BACKOFF` - defaults to `true`. Set to `false` to revert to Laravel default of `0s` backoff.
- `STOMP_BACKOFF_MULTIPLIER` - defaults to `2`. Does nothing if `STOMP_AUTO_BACKOFF` is turned off. Increase to make even bigger interval between two failed jobs.

Job will be re-queued to the queue it came from.

### Headers

[](#headers)

Due to the fact that Laravel doesn't save event headers to `failed_jobs` table, this package is circumventing this by storing headers as a part of the payload in `_headers` key. This is all done automatically behind the scenes so no interaction is needed with it.

If you want to append additional headers to your events, you can do so by implementing `HasHeaders` interface.

Raw data
--------

[](#raw-data)

In case you need your service to communicate with external non-Laravel services it is possible to circumvent Laravel event wrapping by implementing `HasRawData` interface. This will enable you to provide a custom payload to the broker.

Logs
----

[](#logs)

Logs are turned off by default. You can include them by setting env key `STOMP_LOGS=true`.

In case you want to change the default log manager, it can be done in the `asseco-stomp` config file. The new log manager must extend `Illuminate\Log\LogManager`.

Usage
-----

[](#usage)

You can use library now like being native Laravel queue. For usage, you can check [official Laravel queue documentation](https://laravel.com/docs/8.x/queues).

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d80ef47b435b3236b7e50004963549ec39cf27ebcf45d6c033a170e411fa2313?d=identicon)[damithkothalawala](/maintainers/damithkothalawala)

---

Top Contributors

[![Norgul](https://avatars.githubusercontent.com/u/11718157?v=4)](https://github.com/Norgul "Norgul (57 commits)")[![ngaspari](https://avatars.githubusercontent.com/u/33628128?v=4)](https://github.com/ngaspari "ngaspari (6 commits)")[![damithkothalawala](https://avatars.githubusercontent.com/u/8252891?v=4)](https://github.com/damithkothalawala "damithkothalawala (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![josip-milotic](https://avatars.githubusercontent.com/u/42002911?v=4)](https://github.com/josip-milotic "josip-milotic (2 commits)")[![assefvisic](https://avatars.githubusercontent.com/u/60132037?v=4)](https://github.com/assefvisic "assefvisic (1 commits)")

### Embed Badge

![Health badge](/badges/kotalawala-laravel-stomp/health.svg)

```
[![Health](https://phpackages.com/badges/kotalawala-laravel-stomp/health.svg)](https://phpackages.com/packages/kotalawala-laravel-stomp)
```

###  Alternatives

[elevate-digital/nova-charcounted-fields

Text and textarea fields with a character counter.

19110.9k](/packages/elevate-digital-nova-charcounted-fields)[afbora/kirby-loader

Plugins loader from multiple roots for Kirby

1122.3k](/packages/afbora-kirby-loader)[magewirephp/magewire-examples

A Magento 2 module including all sorts of Magewire inspired examples

151.8k](/packages/magewirephp-magewire-examples)

PHPackages © 2026

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