Download the PHP package zenstruck/messenger-monitor-bundle without Composer

On this page you can find all versions of the php package zenstruck/messenger-monitor-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package messenger-monitor-bundle

zenstruck/messenger-monitor-bundle

CI codecov

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

If the packaged UI is not to your liking, you can easily build your own with the provided tools.

Installation

messenger:monitor 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

[!NOTE] This step is required to use the History.

[!NOTE] Only Doctrine ORM is currently available as a storage engine.

Configuration

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

  2. Add the entity class to the bundle config:

  3. Clear Cache:

  4. Create and execute the migration:

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 or the provided tools.

Disable Monitoring

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

  1. When dispatching the message, add the DisableMonitoringStamp:

  2. Add the DisableMonitoringStamp as a class attribute to your message:

  3. 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:

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:

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:

  2. Add the TagStamp as a class attribute to your message:

messenger:monitor:purge 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 for allowed values.

[!NOTE] Schedule this command to run daily with symfony/scheduler and RunCommandMessage.

messenger:monitor:schedule:purge 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.

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

[!NOTE] Schedule this command to run daily with symfony/schedule and RunCommandMessage.

User Interface

[!NOTE] symfony/form (composer require symfony/form) is required for the UI.

[!NOTE] If using symfony/scheduler and the UI, symfony/security-csrf (composer require symfony/security-csrf) is required. CSRF protection and sessions must also be enabled in your config/packages/framework.yaml.

[!NOTE] Storage must be configured for this feature.

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

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 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

Workers Service

WorkerInfo

Transports Service

TransportInfo

QueuedMessage

Schedules Service

ScheduleInfo

TaskInfo

MessageInfo

TriggerInfo

History

[!NOTE] Storage must be configured for this feature.

Storage Service

Specification

Snapshot

Others

Hide Log-Entries

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

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

Full Default Bundle Configuration


All versions of messenger-monitor-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
symfony/framework-bundle Version ^6.4|^7.0
symfony/messenger Version ^6.4|^7.0
zenstruck/bytes Version ^1.0
zenstruck/collection Version ^0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zenstruck/messenger-monitor-bundle contains the following files

Loading the files please wait ....