Symfony Messenger (Messages Queue), how to get queue status?
Asked Answered
S

1

7

I am approaching Symfony 4.4 Message Queue with the Doctrine Transport.

How can I get an overall view of the queue status?

I noticed that Doctrine stores the queue in the table messenger_messages, obviously I could query this table to get this info, but I'm sure that Symfony has a native way to get the queue status.

I would like to get:

  • the number of messages in the queue
  • the number of messages that are in handling in this moment
Straightedge answered 6/5, 2022 at 13:37 Comment(0)
I
3

UPDATE:
As of Symfony 6.2 (current release), there is now a console command to check message stats. Source: Checking the Number of Queued Messages Per Transport


Unfortunatley there is no native way in Symfony (as of v5.4/v6) with the default message queue. But possible solutions are:

  1. As you said, take a look in to the message table
  2. Extend the console with your own commands you need (for example reading the message table and print the needed informations)
  3. Using alternative message system which has this functionality already build in (such as RabbitMQ)
Iand answered 6/9, 2022 at 9:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.