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

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

zenstruck/messenger-monitor-bundle
==================================

Batteries included UI to monitor your Messenger workers, transports, schedules, and messages.

v0.6.0(5mo ago)261561.9k—9.8%28[50 issues](https://github.com/zenstruck/messenger-monitor-bundle/issues)[10 PRs](https://github.com/zenstruck/messenger-monitor-bundle/pulls)4MITPHPPHP &gt;=8.1CI passing

Since Feb 16Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/zenstruck/messenger-monitor-bundle)[ Packagist](https://packagist.org/packages/zenstruck/messenger-monitor-bundle)[ Docs](https://github.com/zenstruck/messenger-monitor-bundle)[ GitHub Sponsors](https://github.com/kbond)[ GitHub Sponsors](https://github.com/nikophil)[ RSS](/packages/zenstruck-messenger-monitor-bundle/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (24)Versions (11)Used By (4)

zenstruck/messenger-monitor-bundle
==================================

[](#zenstruckmessenger-monitor-bundle)

[![CI](https://github.com/zenstruck/messenger-monitor-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/zenstruck/messenger-monitor-bundle/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/f04c07bdd961b88c23cf52ee8e69c10cc80a72ce5a6a9f4c5f2a90e5486762f0/68747470733a2f2f636f6465636f762e696f2f67682f7a656e73747275636b2f6d657373656e6765722d6d6f6e69746f722d62756e646c652f67726170682f62616467652e7376673f746f6b656e3d6c4d5a67354c6459555a)](https://codecov.io/gh/zenstruck/messenger-monitor-bundle)

Batteries included UI to monitor your Messenger workers, transports, schedules, and messages.

[![Screenshot](screenshot.png)](screenshot.png)

If the packaged UI is not to your liking, you can easily build your own with the [provided tools](#advanced-usage).

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

[](#installation)

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

`messenger:monitor` Command
---------------------------

[](#messengermonitor-command)

With zero configuration, you can run the `messenger:monitor` command to see information about your running workers and transports. If storage is configured, it displays a historical snapshot whose period can be customized with the `--period` option.

Storage
-------

[](#storage)

Note

This step is required to use the [User Interface](#user-interface) and [History](#history).

Note

Only Doctrine ORM is currently available as a storage engine.

### Configuration

[](#configuration)

1. Create a `ProcessedMessage` entity that extends `Zenstruck\Messenger\Monitor\History\Model\ProcessedMessage`in your app:

    ```
    // src/Entity/ProcessedMessage.php

    namespace App\Entity;

    use Zenstruck\Messenger\Monitor\History\Model\ProcessedMessage as BaseProcessedMessage;
    use Doctrine\ORM\Mapping as ORM;

    #[ORM\Entity(readOnly: true)]
    #[ORM\Table('processed_messages')]
    class ProcessedMessage extends BaseProcessedMessage
    {
        #[ORM\Id]
        #[ORM\GeneratedValue]
        #[ORM\Column]
        private ?int $id = null;

        public function id(): ?int
        {
            return $this->id;
        }
    }
    ```
2. Add the entity class to the bundle config:

    ```
    # config/packages/zenstruck_messenger_monitor.yaml

    zenstruck_messenger_monitor:
        storage:
            orm:
                entity_class: App\Entity\ProcessedMessage
    ```

    > \[!NOTE\] If you are using a different entity manager, you must also set the `zenstruck_messenger_monitor.history.orm_manager` parameter to the name of that manager.
3. Clear Cache:

    ```
    bin/console cache:clear
    ```
4. Create and execute the migration:

    ```
    bin/console doctrine:migrations:diff
    bin/console doctrine:migrations:migrate
    ```

### Usage

[](#usage)

Once configured, consumed messages are tracked and saved. These *processed messages*contain a lot of useful information and can be viewed in the [user interface](#user-interface)or the [provided tools](#history).

#### Disable Monitoring

[](#disable-monitoring)

You may want to disable monitoring for certain messages. There are several ways to do this:

1. When dispatching the message, add the `DisableMonitoringStamp`: ```
    use Zenstruck\Messenger\Monitor\Stamp\DisableMonitoringStamp;

    /** @var \Symfony\Component\Messenger\MessageBusInterface $bus */

    $bus->dispatch(new MyMessage(), [new DisableMonitoringStamp()])
    ```
2. Add the `DisableMonitoringStamp` as a class attribute to your message (or parent class/interface): ```
    use Zenstruck\Messenger\Monitor\Stamp\DisableMonitoringStamp;

    #[DisableMonitoringStamp]
    class MyMessage
    {
    }
    ```

    You may want to disable monitoring for messages that are dispatched without any handler. You can do this by using the `DisableMonitoringStamp` with optional constructor argument `true`: ```
    use Zenstruck\Messenger\Monitor\Stamp\DisableMonitoringStamp;

    #[DisableMonitoringStamp(onlyWhenNoHandler: true)]
    class MyMessage
    {
    }
    ```
3. Add the message class to the `exclude` config option (can be abstract/interface): ```
    # config/packages/zenstruck_messenger_monitor.yaml

    zenstruck_messenger_monitor:
        storage:
            exclude:
                - App\Message\MyMessage
    ```

#### Description

[](#description)

The stored `ProcessedMessage` has a description property. This is helpful to differentiate between messages in the user interface. By default, this is the *stringified* version of the message object (if it implements `\Stringable`). You can add the `DescriptionStamp` to customize:

```
use Zenstruck\Messenger\Monitor\Stamp\DescriptionStamp;

/** @var \Symfony\Component\Messenger\MessageBusInterface $bus */

$bus->dispatch(new MyMessage(), [new DescriptionStamp('some custom description')])
```

#### Tags

[](#tags)

To help with filtering processed messages, they can have one or more *tags*. Some tags are added automatically (like `schedule` if it's a scheduled message) but you can also add your own in one of two ways:

1. When dispatching the message, add one or more `TagStamp`'s: ```
    use Zenstruck\Messenger\Monitor\Stamp\TagStamp;

    /** @var \Symfony\Component\Messenger\MessageBusInterface $bus */

    $bus->dispatch(new MyMessage(), [new TagStamp('tag-1'), new TagStamp('tag-2')])
    ```
2. Add the `TagStamp` as a class attribute to your message (and parent class/interface): ```
    use Zenstruck\Messenger\Monitor\Stamp\TagStamp;

    #[TagStamp('tag-1')]
    #[TagStamp('tag-2')]
    class MyMessage
    {
    }
    ```

    > \[!TIP\] You can also add the `TagStamp` attribute to parent classes/interfaces.

#### `messenger:monitor:purge` Command

[](#messengermonitorpurge-command)

If your app handles a lot of messages, the processed message database table will get very large. The `messenger:monitor:purge` clears messages older than a specific date: See [`Period`](https://github.com/zenstruck/messenger-monitor-bundle/blob/1.x/src/History/Period.php#L19) for allowed values.

```
bin/console messenger:monitor:purge # by default, purges all messages older than 1 month

bin/console messenger:monitor:purge --older-than all
bin/console messenger:monitor:purge --older-than 1-day
bin/console messenger:monitor:purge --older-than 1-week

bin/console messenger:monitor:purge --exclude-schedules # ignore messages tagged with "schedule"
```

Note

Schedule this command to run daily with `symfony/scheduler` and [`RunCommandMessage`](https://symfony.com/doc/6.4/messenger.html#trigger-a-command).

#### `messenger:monitor:schedule:purge` Command

[](#messengermonitorschedulepurge-command)

If using `symfony/scheduler`, you might want to keep a specific # of these messages as they might run very infrequently. When running `messenger:monitor:purge`, add the `--exclude-schedules` option to avoid deleting schedule history. Then run `messenger:monitor:schedule:purge` to keep a specific number (10 by default) of *task run histories*.

```
bin/console messenger:monitor:schedule:purge # by default, keeps 10 runs for each task

bin/console messenger:monitor:schedule:purge --keep 5 # keep only 5
```

Use the `--remove-orphans` option to delete schedule task runs that are no longer associated with a schedule.

```
bin/console messenger:monitor:schedule:purge --remove-orphans
```

Note

Schedule this command to run daily with `symfony/schedule` and [`RunCommandMessage`](https://symfony.com/doc/6.4/messenger.html#trigger-a-command).

User Interface
--------------

[](#user-interface)

Note

[Storage](#storage) must be configured for this feature.

Create a controller that extends `Zenstruck\Messenger\Monitor\Controller\MessengerMonitorController`in your app:

```
// src/Controller/MessengerMonitorController.php

namespace App\Controller;

use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Zenstruck\Messenger\Monitor\Controller\MessengerMonitorController as BaseMessengerMonitorController;

#[Route('/admin/messenger')] // path prefix for the controllers
#[IsGranted('ROLE_ADMIN')] // alternatively, use a firewall
final class MessengerMonitorController extends BaseMessengerMonitorController
{
}
```

You can now access the dashboard at: `/admin/messenger` or with the route `zenstruck_messenger_monitor_dashboard`.

Warning

It is important that your `MessengerMonitorController` is only accessible by site administrators as it contains sensitive application information. Use either the `IsGranted` attribute on your controller as shown above and/or ensure the controller is behind an [access-controlled firewall](https://symfony.com/doc/current/security.html#securing-url-patterns-access-control)that only allows site administrators.

Note

Install `knplabs/knp-time-bundle` (`composer require knplabs/knp-time-bundle`) to display friendlier times and durations in the UI.

Note

Install `lorisleiva/cron-translator` (`composer require lorisleiva/cron-translator`) to display friendlier CRON values for your scheduled tasks.

Advanced Usage
--------------

[](#advanced-usage)

### `Workers` Service

[](#workers-service)

#### `WorkerInfo`

[](#workerinfo)

### `Transports` Service

[](#transports-service)

#### `TransportInfo`

[](#transportinfo)

#### `QueuedMessage`

[](#queuedmessage)

### `Schedules` Service

[](#schedules-service)

#### `ScheduleInfo`

[](#scheduleinfo)

#### `TaskInfo`

[](#taskinfo)

#### `MessageInfo`

[](#messageinfo)

#### `TriggerInfo`

[](#triggerinfo)

### History

[](#history)

Note

[Storage](#storage) must be configured for this feature.

#### `Storage` Service

[](#storage-service)

#### `Specification`

[](#specification)

#### `Snapshot`

[](#snapshot)

Others
------

[](#others)

### Hide Log-Entries

[](#hide-log-entries)

While you run `php bin/console messenger:consume async [-vv]` you see a lot of messages like this one.

```
[cache] Lock acquired, now computing item "zenstruck_messenger_monitor.worker.xxx" ["key" => "zenstruck_messenger_monitor.worker.xxx"]

```

If you want to not display them, you can disable them with adding `"!cache"` to the console-channels in `config/packages/monolog.yaml`

```
when@dev:
  monolog:
    handlers:
      #...
      console:
        #...
          channels: ["!event", "!doctrine", "!console", "!cache"]
```

Full Default Bundle Configuration
---------------------------------

[](#full-default-bundle-configuration)

```
zenstruck_messenger_monitor:
    storage:
        # Message classes to disable monitoring for (can be abstract/interface)
        exclude:              []
        orm:

            # Your Doctrine entity class that extends "Zenstruck\Messenger\Monitor\History\Model\ProcessedMessage"
            entity_class:         ~
    cache:
      pool: app.cache # If using workers in docker. You can use shared cache pool for all workers
      expired_worker_ttl:  3600
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance74

Regular maintenance activity

Popularity57

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.2% 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 ~73 days

Total

11

Last Release

92d ago

Major Versions

v0.6.0 → 1.x-dev2026-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/707369cc916e0ea1aacbf077dcba464f611cef879f024d8944311a54a15224b3?d=identicon)[kbond](/maintainers/kbond)

---

Top Contributors

[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (186 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (21 commits)")[![dontfreakout](https://avatars.githubusercontent.com/u/1829574?v=4)](https://github.com/dontfreakout "dontfreakout (7 commits)")[![balazscsaba2006](https://avatars.githubusercontent.com/u/1202594?v=4)](https://github.com/balazscsaba2006 "balazscsaba2006 (2 commits)")[![priyadi](https://avatars.githubusercontent.com/u/1102197?v=4)](https://github.com/priyadi "priyadi (2 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (2 commits)")[![fracsi](https://avatars.githubusercontent.com/u/690307?v=4)](https://github.com/fracsi "fracsi (1 commits)")[![golliholzland](https://avatars.githubusercontent.com/u/132348430?v=4)](https://github.com/golliholzland "golliholzland (1 commits)")[![hhamon](https://avatars.githubusercontent.com/u/235550?v=4)](https://github.com/hhamon "hhamon (1 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (1 commits)")[![bobvandevijver](https://avatars.githubusercontent.com/u/1835343?v=4)](https://github.com/bobvandevijver "bobvandevijver (1 commits)")[![lbae](https://avatars.githubusercontent.com/u/7318363?v=4)](https://github.com/lbae "lbae (1 commits)")[![SpartakusMd](https://avatars.githubusercontent.com/u/438308?v=4)](https://github.com/SpartakusMd "SpartakusMd (1 commits)")[![czachor](https://avatars.githubusercontent.com/u/1479296?v=4)](https://github.com/czachor "czachor (1 commits)")[![faizanakram99](https://avatars.githubusercontent.com/u/10880992?v=4)](https://github.com/faizanakram99 "faizanakram99 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/doctrine-messenger

Symfony Doctrine Messenger Bridge

53186.7M156](/packages/symfony-doctrine-messenger)[symfony/amqp-messenger

Symfony AMQP extension Messenger Bridge

29555.6M59](/packages/symfony-amqp-messenger)[symfony/redis-messenger

Symfony Redis extension Messenger Bridge

21846.4M33](/packages/symfony-redis-messenger)[symfony/amazon-sqs-messenger

Symfony Amazon SQS extension Messenger Bridge

4612.5M15](/packages/symfony-amazon-sqs-messenger)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)[prooph/event-store-symfony-bundle

109253.5k8](/packages/prooph-event-store-symfony-bundle)

PHPackages © 2026

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