From 6d84eefccd905e791aba72f2700366a21f623122 Mon Sep 17 00:00:00 2001 From: Maxime Doutreluingne Date: Sun, 2 Oct 2022 10:12:47 +0200 Subject: [PATCH] [Messenger] Add new `messenger:stats` command that return a list of transports with their "to be processed" message count. --- messenger.rst | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/messenger.rst b/messenger.rst index 65d9da096ed..508e20f363a 100644 --- a/messenger.rst +++ b/messenger.rst @@ -640,8 +640,35 @@ You can limit the worker to only process messages from specific queue(s): # you can pass the --queues option more than once to process multiple queues $ php bin/console messenger:consume my_transport --queues=fasttrack1 --queues=fasttrack2 -To allow using the ``queues`` option, the receiver must implement the -:class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\QueueReceiverInterface`. +.. note:: + + To allow using the ``queues`` option, the receiver must implement the + :class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\QueueReceiverInterface`. + +.. _messenger-message-count: + +Knowing the number of messages in the "queue" for transport(s) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want to know how many messages are in the "queues", +you can do so with the ``messenger:stats`` command: + +.. code-block:: terminal + + # displays the number of messages in the "queue" for all transports + $ php bin/console messenger:stats + + # or specific transport(s) only + $ php bin/console messenger:stats my_transport_name other_transport_name + +.. note:: + + This command won't work if the configured transport's receiver does not implement + :class:`Symfony\\Component\\Messenger\\Transport\\Receiver\\MessageCountAwareInterface`. + +.. versionadded:: 6.2 + + The ``messenger:stats`` command was introduced in Symfony 6.2. .. _messenger-supervisor: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy