Magento 2 RabbitMQ Monitor: AMQP Queue Stats in the Admin

Magento 2 RabbitMQ monitoring inside the admin: connection config, live queue stats, and notifications for harmful queue states — no separate UI needed.

What leads operators to the RabbitMQ management UI

Any Magento 2 store using async processing — async order export, async catalogue sync, async image conversion — depends on RabbitMQ staying healthy. When a queue backs up, or a consumer dies, or a message rate collapses, the first sign is usually a late order or a missing product update. By that point, the damage is done.

The standard response is to open the RabbitMQ management UI: a separate web interface running on a different host and port, protected by credentials most operators don’t have bookmarked. For developers this is a minor context switch. For operations and support staff, it is an obstacle that delays diagnosis.

The AMQP Monitor module brings RabbitMQ visibility directly into the Magento 2 admin — no separate credentials, no URL to remember, no context switch.

A read-only admin panel page that shows your RabbitMQ server version, connection configuration, and live queue statistics — ready/unacked counts, message rates, queue state — alongside configurable notifications for queue states that signal a processing problem.


What the monitor shows

The monitor page is at System → Tools → BroCode AMQP Monitor.

Server summary — version badges at the top of the page show the RabbitMQ server version, management plugin version, Erlang/OTP version, and cluster name. Useful for confirming which environment you’re looking at.

AMQP configuration — the left-hand table displays the active queue/amqp connection settings from Magento’s deployment configuration: host, port, AMQP user, virtual host, and SSL mode. Sensitive values are masked.

Management API configuration — the right-hand table shows the management endpoint URL and API credentials configured in the module settings.

Queue information — a table listing all queues the RabbitMQ management API reports:

ColumnWhat it shows
NameQueue name as registered in Magento or RabbitMQ directly
Typeclassic or quorum
FeaturesPersistence flags (D = durable)
Staterunning, idle, or down
ReadyMessages waiting to be consumed
UnackedMessages delivered to a consumer but not yet acknowledged
TotalReady + Unacked
Incoming rateMessages arriving per second
Deliver/get rateMessages leaving per second
Ack rateAcknowledgements per second
AMQP Monitor queue overview showing server version, configuration, and live queue statistics

Reading the queue table: four patterns

Most Magento 2 RabbitMQ problems show up as one of four shapes in the Ready, Unacked and rate columns. Each points at a different layer.

What you seeWhat it usually meansWhere to look next
Ready climbs, deliver/get rate is 0No consumer is attached to the queueWhether the consumer is started at all (below)
Unacked stays above 0 and grows, Ready stays flatA consumer took messages and hangs on themThe consumer process: a stuck PHP process, a slow external API, a lock
Ready drains to 0, refills, drains againConsumers exit when the queue is empty and the cron runner restarts them (queue/consumers_wait_for_messages set to 0)Nothing, unless the refill outpaces the drain
Queue missing from the listThe topology was never declared on this brokerbin/magento setup:upgrade against the RabbitMQ connection in env.php

When nothing consumes: how Magento starts consumers

Magento’s own cron job consumers_runner (from Magento_MessageQueue, scheduled every minute) spawns the consumers. Its settings live under cron_consumers_runner in app/etc/env.php, and the defaults in Magento\MessageQueue\Model\Cron\ConsumersRunner explain most "nothing consumes" reports:

  • cron_run defaults to true. Set it to false and the job does nothing; then something else, usually Supervisor or systemd, has to run bin/magento queue:consumers:start <name>.
  • consumers is an allowlist. Empty means every consumer; a non-empty list silently skips all others.
  • max_messages defaults to 10000: a consumer exits after that many messages and is respawned on a later run.
  • queue/only_spawn_when_message_available (on by default) checks the queue first and starts no process for an empty one.
  • queue/consumers_wait_for_messages defaults to 1, so a started consumer keeps waiting for new messages. At 0 it exits as soon as the queue is empty.

A consumer whose connection is not configured is skipped, and the runner only logs an info message: Consumer "…" skipped as required connection "amqp" is not configured. bin/magento queue:consumers:list shows which consumers exist; it does not show which ones are running.


Notifications

The monitor page shows the state when someone looks. Notifications cover the time nobody does. They are off by default; enable them under Notifications in the module configuration and set a recipient under E-Mail.

The cron job amqp_message_count_check runs hourly, at minute 0. It reads every queue from the management API, compares each queue’s Ready count with the reading stored one run earlier (kept in Magento’s flag table), and sends one e-mail per queue that crosses either threshold:

SettingDefaultFires when
Alert Message Count300Ready is above this, regardless of trend
Minimum Message Count + Min Growth Percentage100 and 5 %Ready is above 100 and grew by at least 5 % since the last run

The growth rule catches a consumer that died an hour ago before the queue reaches the hard limit. Version 1.1.3 fixes the case this rule exists for: a queue that was empty at the last run and is above the minimum now. Earlier versions failed that run with a division by zero and sent nothing. A queue that disappeared between two runs is now skipped instead of failing the run.

One limitation: if the management API cannot be reached when the job runs, the module stores an empty reading and sends nothing. It does not alert on its own blind spot. Monitor RabbitMQ’s availability separately.


View on GitHub — Download ZIP


Who it is for

  • Operations teams running async Magento workloads (order export, catalogue sync, image optimisation) who need queue health visible without a separate RabbitMQ management login.
  • Support engineers investigating delayed processing — "where did the message go?" is answerable from inside the admin.
  • Developers configuring or debugging async consumers who want to confirm the queue is draining during a test run.

Who should skip it

  • Stores not using RabbitMQ. If queue/amqp is not configured in Magento’s env.php, there is nothing for this module to connect to.
  • Teams with mature external monitoring (Prometheus + Grafana, CloudWatch, Datadog) already alerting on RabbitMQ metrics. The module adds admin-panel visibility, not a replacement for dedicated monitoring infrastructure.

Installation

composer require brocode/module-amqp-monitor
bin/magento module:enable BroCode_AmqpMonitor
bin/magento setup:upgrade
bin/magento cache:flush

No database schema changes. The monitor page appears under System → Tools → BroCode AMQP Monitor immediately after setup.

Configuration

Under Stores → Configuration → Services → BroCode AMQP Monitor:

SettingDescription
Management EndpointFull URL of the RabbitMQ management API, e.g. https://amqp-management.example.com/api/
BasicAuth UsernameAPI user — defaults to the AMQP connection username if left empty
BasicAuth PasswordAPI password — defaults to the AMQP connection password if left empty
AMQP Monitor configuration — management endpoint and BasicAuth credentials

The RabbitMQ management plugin must be enabled (rabbitmq-plugins enable rabbitmq_management). The API user needs at least the monitoring tag in RabbitMQ.


Compatibility

Magento versionPHPStatus
2.4.8-p58.4Installed and enabled in the test sandbox
2.4.4 to 2.4.98.1 to 8.4Allowed by the package constraints (magento/framework 103+, magento/module-amqp 100.4+)

Requires RabbitMQ with the management plugin enabled. Current version: 1.1.3.


Related reading


FAQ

Does the module store queue data in Magento’s database?

No. Queue statistics are fetched live from the RabbitMQ management API on every page load. Nothing is persisted — the view is always current.

Do I need the RabbitMQ management plugin?

Yes. The module connects to the HTTP management API that the plugin exposes. If the plugin is not active, the monitor page will report a connection error.

What RabbitMQ permissions does the API user need?

The monitoring tag in RabbitMQ grants read access to the management API without write privileges. A dedicated monitoring user is recommended over using the full admin credentials.

Does it work with RabbitMQ clusters?

Yes. The management API exposes cluster metadata (cluster name, node versions), which the module displays in the server summary section. Queue stats are aggregated across the cluster by the management API.

Can I use it with the MySQL queue instead of RabbitMQ?

No. This module connects specifically to the RabbitMQ management API. With the MySQL queue, messages live in the database tables queue_message and queue_message_status, and there is no management API to read.

Does a notification fire when a queue stops existing?

No. Since 1.1.3 a queue that is missing from the current reading is skipped. Before that, the check run failed.

How do I investigate what a failing consumer was doing?

The monitor shows queue-level health but not per-message log lines. For that, install Magento 2 Log Tracing — it stamps every log line a consumer process writes with a shared trace ID, so you can grep for the ID from a specific consumer run across var/log/ and reconstruct exactly what happened.

Related Topics

Ask a module question or suggest improvements

Tell us your use case and the module context. Spam protection is handled by ALTCHA.




More Projects