PHPackages                             elielelie/laravel-activemq - 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. elielelie/laravel-activemq

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

elielelie/laravel-activemq
==========================

Laravel ActiveMQ driver

v1.1.0(2mo ago)04.0k↓64.3%2MITPHPPHP ^7.4|^8.0

Since Mar 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/eliel-elie/laravel-activemq)[ Packagist](https://packagist.org/packages/elielelie/laravel-activemq)[ RSS](/packages/elielelie-laravel-activemq/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

Laravel ActiveMQ driver
=======================

[](#laravel-activemq-driver)

[![Total Downloads](https://camo.githubusercontent.com/08bffeb08bdeb210a8ab798ce5bfd366ebdeac1d84cd9a408113d34310bc5281/68747470733a2f2f706f7365722e707567782e6f72672f656c69656c656c69652f6c61726176656c2d6163746976656d712f642f746f74616c2e737667)](https://packagist.org/packages/elielelie/laravel-activemq)[![Latest Stable Version](https://camo.githubusercontent.com/3f92fed6c4df11c9d44b9958afbe985f4304f1f6cdb57ec6d0f640e5163f3b47/68747470733a2f2f706f7365722e707567782e6f72672f656c69656c656c69652f6c61726176656c2d6163746976656d712f762f737461626c652e737667)](https://packagist.org/packages/elielelie/laravel-activemq)[![License](https://camo.githubusercontent.com/d358f62d1890e16550c595929a7380513a2838b4b78cd8dda9408b7994553513/68747470733a2f2f706f7365722e707567782e6f72672f656c69656c656c69652f6c61726176656c2d6163746976656d712f6c6963656e73652e737667)](https://packagist.org/packages/elielelie/laravel-activemq)

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

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

[](#installation)

`composer require elielelie/laravel-activemq`

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

```
QUEUE_CONNECTION=activemq

```

Variables:

```
ACTIVEMQ_PROTOCOL      protocol (defaults to TCP)
ACTIVEMQ_HOST          broker host (defaults to 127.0.0.1)
ACTIVEMQ_PORT          port where STOMP is exposed in your broker (defaults to 61613)
ACTIVEMQ_USERNAME      broker username (defaults to admin)
ACTIVEMQ_PASSWORD      broker password (defaults to admin)

```

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

```
ACTIVEMQ_QUEUE=...

```

```
default;email

```

You can see all other available `.env` variables, their defaults and usage explanation within the [config file](config/activemq.php)

You can publish the configuration file by running:

`$ php artisan vendor:publish --provider="Elielelie\ActiveMQ\ActiveMQServiceProvider" `

Usage
-----

[](#usage)

### Dispatching Jobs

[](#dispatching-jobs)

You can dispatch jobs to ActiveMQ just like any other Laravel queue driver:

```
use App\Jobs\ProcessOrder;

// Dispatch to the default queue
ProcessOrder::dispatch($order);

// Dispatch to a specific queue
ProcessOrder::dispatch($order)->onQueue('orders');
```

### Delayed Jobs (Scheduling)

[](#delayed-jobs-scheduling)

The driver supports delayed jobs using the `later` method or `delay()` helper:

```
// Delay job execution by 10 minutes
ProcessOrder::dispatch($order)->delay(now()->addMinutes(10));
```

### Message Persistence

[](#message-persistence)

By default, messages are sent according to the `ACTIVEMQ_PERSISTENT` environment variable.

- To ensure messages survive a broker restart, set `ACTIVEMQ_PERSISTENT=true`.
- If you need to override headers for a specific job, you can implement the `HasHeaders` contract in your Job class.

### Health Check

[](#health-check)

You can verify the connection to the ActiveMQ broker using the `healthCheck` method on the connection:

```
use Illuminate\Support\Facades\Queue;

$isConnected = Queue::connection('activemq')->healthCheck();

if (!$isConnected) {
    // Handle connection failure
}
```

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

[](#failed-jobs)

For the sake of simplicity and brevity ActiveMQJob 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:

- `ACTIVEMQ_AUTO_TRIES` - defaults to `true`. Set to `false` to revert to Laravel default of 0 retries.
- `ACTIVEMQ_AUTO_BACKOFF` - defaults to `true`. Set to `false` to revert to Laravel default of 0s backoff.
- `ACTIVEMQ_BACKOFF_MULTIPLIER` - defaults to `2`. Does nothing if `ACTIVEMQ_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.

Laravel Horizon Support
-----------------------

[](#laravel-horizon-support)

This package now supports Laravel Horizon for advanced queue management with multiple workers and auto-scaling capabilities.

### Configuration

[](#configuration)

To enable Horizon support, add these environment variables:

```
ACTIVEMQ_HORIZON_ENABLED=true
ACTIVEMQ_HORIZON_ISOLATE=true

```

### Horizon Configuration Example

[](#horizon-configuration-example)

Add this configuration to your `config/horizon.php`:

```
'environments' => [
    'production' => [
        'activemq-default' => [
            'connection' => 'activemq',
            'queue' => ['default'],
            'balance' => 'simple',
            'processes' => 3,
        ],
        'activemq-emails' => [
            'connection' => 'activemq',
            'queue' => ['email'],
            'balance' => 'auto',
            'processes' => 2,
            'maxProcesses' => 5,
        ],
        'activemq-notifications' => [
            'connection' => 'activemq',
            'queue' => ['notifications'],
            'balance' => 'simple',
            'processes' => 1,
        ],
    ],
],
```

### Multiple Queue Setup

[](#multiple-queue-setup)

You can define multiple queues in your environment configuration:

```
ACTIVEMQ_QUEUE=default;email;notifications

```

Each supervisor in Horizon can process specific queues, allowing for:

- **Worker Isolation**: Different workers for different queue types
- **Auto-Scaling**: Automatic worker scaling based on queue load
- **Priority Processing**: Different process counts and strategies per queue

### Balancing Strategies

[](#balancing-strategies)

- **simple**: Fixed number of workers distributed evenly
- **auto**: Dynamic worker allocation based on queue load
- **false**: Process queues in order without balancing

Logs
----

[](#logs)

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

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

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97% 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 ~115 days

Recently: every ~251 days

Total

11

Last Release

69d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1af6380064aee246aaface6c2b36f5773e670773e7b7f02df1de33c52dd487f4?d=identicon)[elielelie](/maintainers/elielelie)

---

Top Contributors

[![eliel-elie](https://avatars.githubusercontent.com/u/78655902?v=4)](https://github.com/eliel-elie "eliel-elie (32 commits)")[![misakstvanu](https://avatars.githubusercontent.com/u/42741294?v=4)](https://github.com/misakstvanu "misakstvanu (1 commits)")

---

Tags

phplaravelqueuedriverstompactiveMQ

### Embed Badge

![Health badge](/badges/elielelie-laravel-activemq/health.svg)

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

###  Alternatives

[renoki-co/horizon-exporter

Export Laravel Horizon metrics using this Prometheus exporter.

24152.8k](/packages/renoki-co-horizon-exporter)[webparking/laravel-queue-ensurer

This composer package provides a Laravel queue ensurer.

6416.1k](/packages/webparking-laravel-queue-ensurer)[lokielse/laravel-mns

Aliyun MNS Queue Driver For Laravel

2614.9k](/packages/lokielse-laravel-mns)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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