PHPackages                             softlab/messenger-monitor-bundle - 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. softlab/messenger-monitor-bundle

ActiveSymfony-bundle[Queues &amp; Workers](/categories/queues)

softlab/messenger-monitor-bundle
================================

Symfony Messenger monitoring bundle with Supervisor integration, queue stats, and failed message management

v1.2.1(2w ago)113↓50%MITPHPPHP &gt;=8.2CI passing

Since May 19Pushed 2w agoCompare

[ Source](https://github.com/Softer/messenger_monitor)[ Packagist](https://packagist.org/packages/softlab/messenger-monitor-bundle)[ RSS](/packages/softlab-messenger-monitor-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (13)Versions (4)Used By (0)

Softer Messenger Monitor Bundle
===============================

[](#softer-messenger-monitor-bundle)

Symfony bundle that monitors Messenger queues by reading worker status directly from Supervisor. No cache, no heartbeats, no race conditions - just asks Supervisor every time (via `supervisorctl` or XML-RPC over HTTP).

What it does
------------

[](#what-it-does)

- Gets worker status from Supervisor with start/stop/restart control (via CLI or HTTP)
- Counts pending messages per queue (Doctrine transport)
- Tracks message processing history: handled, failed, retried - with duration and memory usage
- Lists failed messages with retry/remove
- Auto-detects queue names from your Messenger transport config

Everything is available as PHP services, Twig functions, and JSON API. No UI - you build your own admin pages.

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

[](#requirements)

- PHP 8.2+
- Symfony 7.0+ / 8.0+
- Supervisor
- Doctrine DBAL (for queue stats and history)

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

[](#installation)

```
composer require softlab/messenger-monitor-bundle
```

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

[](#configuration)

Works out of the box with zero config. Queue names are auto-detected from your `framework.messenger.transports`, history table is created automatically on first message.

Override defaults only if you need to:

```
# config/packages/softlab_messenger_monitor.yaml
softlab_messenger_monitor:
    supervisor:
        supervisorctl_path: supervisorctl   # path to binary
        process_group: ~                    # filter by group (null = all)
        url: ~                              # XML-RPC URL (see below)
    queue:
        connection: default                 # Doctrine DBAL connection
        table_name: messenger_messages
    history:
        enabled: true                       # message processing history
        table_name: messenger_monitor_history
```

Usage
-----

[](#usage)

### PHP services

[](#php-services)

```
use SoftLab\MessengerMonitorBundle\Supervisor\SupervisorManagerInterface;
use SoftLab\MessengerMonitorBundle\Queue\QueueStatsProviderInterface;
use SoftLab\MessengerMonitorBundle\Failed\FailedMessageManager;
use SoftLab\MessengerMonitorBundle\History\MessageHistoryProviderInterface;

class DashboardController
{
    public function index(
        SupervisorManagerInterface $supervisor,
        QueueStatsProviderInterface $queueStats,
        FailedMessageManager $failedMessages,
        MessageHistoryProviderInterface $history,
    ): Response {
        $workers = $supervisor->getWorkers();       // WorkerInfo[]
        $queues = $queueStats->getQueues();         // QueueInfo[]
        $failed = $failedMessages->list();          // FailedMessage[]

        $entries = $history->getHistory(50);         // MessageHistoryEntry[]
        $stats = $history->getStats();              // ['handled' => N, 'failed' => N, 'retried' => N]
        $byQueue = $history->getStatsByQueue();     // ['async' => ['handled' => N, ...], ...]
        // ...
    }
}
```

### Twig

[](#twig)

Requires `symfony/twig-bundle`.

```
{% for worker in messenger_workers() %}
    {{ worker.name }}: {{ worker.status }} (PID {{ worker.pid }})
{% endfor %}

{% for queue in messenger_queues() %}
    {{ queue.name }}: {{ queue.messageCount }} pending
{% endfor %}

{{ messenger_failed_count() }} failed messages
{{ messenger_total_pending() }} messages in queues

{% set stats = messenger_history_stats() %}
Handled: {{ stats.handled }}, Failed: {{ stats.failed }}, Retried: {{ stats.retried }}

{% for entry in messenger_history(20) %}
    {{ entry.shortClass }}: {{ entry.status }} ({{ entry.durationMs }}ms, {{ entry.memoryBytes }} bytes)
{% endfor %}
```

### JSON API

[](#json-api)

Import routes in your app:

```
# config/routes/softlab_messenger_monitor.yaml
softlab_messenger_monitor:
    resource: '@SoftLabMessengerMonitorBundle/config/routes.php'
```

MethodPathDescriptionGET`/summary`Workers, queues, failed countGET`/workers`Supervisor worker listPOST`/workers/{name}/start`Start workerPOST`/workers/{name}/stop`Stop workerPOST`/workers/{name}/restart`Restart workerGET`/queues`Pending messages per queueGET`/failed`Failed messagesPOST`/failed/{id}/retry`Retry failed messageDELETE`/failed/{id}`Remove failed messageGET`/history`Processing history with statsAll paths are relative to `/api/messenger-monitor`.

Supervisor connection
---------------------

[](#supervisor-connection)

By default the bundle runs `supervisorctl` on the local machine. If Supervisor is on a remote host or you don't want to shell out, use the HTTP adapter - it talks to Supervisor's XML-RPC interface.

Two transport options:

**HTTP (inet\_http\_server)**

Enable `inet_http_server` in your `supervisord.conf`:

```
[inet_http_server]
port = 127.0.0.1:9001
```

```
softlab_messenger_monitor:
    supervisor:
        url: 'http://127.0.0.1:9001/RPC2'
```

Requires `symfony/http-client`:

```
composer require symfony/http-client
```

**Unix socket**

Works with the default `unix_http_server` - no extra config in Supervisor needed:

```
softlab_messenger_monitor:
    supervisor:
        url: 'unix:///var/run/supervisor.sock'
```

No extra dependencies required.

Both options support `%env()%`:

```
softlab_messenger_monitor:
    supervisor:
        url: '%env(SUPERVISOR_URL)%'
```

When `url` is set, `supervisorctl_path` is ignored.

Message history
---------------

[](#message-history)

Every processed message is recorded with:

- message class and queue name
- status: `handled`, `failed`, or `retried`
- processing duration (ms) and memory delta (bytes)
- error message (for failed/retried)

The `messenger_monitor_history` table is created automatically when the first message is processed. Disable with `history.enabled: false` if you don't need it.

Demo
----

[](#demo)

The `demo/` directory has a working Symfony app with Supervisor workers in Docker. Three panels: message producer, worker status with controls, queue stats. History panel with status and queue filters.

```
docker compose run --rm demo composer install
docker compose up demo
# http://localhost:8080
```

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance96

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Total

4

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61ea7255e8a210fd0ac864a6858d25f1b9ef53990be3c867a16b5d53d70ceaa9?d=identicon)[Softer](/maintainers/Softer)

---

Top Contributors

[![Softer](https://avatars.githubusercontent.com/u/169776?v=4)](https://github.com/Softer "Softer (6 commits)")

---

Tags

symfonyqueuemonitorMessengersupervisor

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/softlab-messenger-monitor-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/softlab-messenger-monitor-bundle/health.svg)](https://phpackages.com/packages/softlab-messenger-monitor-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9017.2k55](/packages/open-dxp-opendxp)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1715.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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