Symfony Messenger (Messages Queue), ho to get queue status?

Viewed 335

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

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