Symfony Messenger(消息队列),如何获得队列状态?
我正在接近 symfony 4.4消息队列带有学说运输。
如何总体看出队列状态?
我注意到,学说将队列存储在表messenger_messages
中,显然我可以查询此表以获取此信息,但是我敢肯定,Symfony有一种本机方法来获得排队状态。
我想得到:
- 队列中的消息数量
- 在此刻处理的消息数量
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:
从Symfony 6.2(当前版本)开始,现在有一个控制台命令检查消息统计数据。
来源:检查每次运输的排队消息
不幸的是,Symfony中没有本机的方式(从v5.4/V6)与默认消息队列没有。
但是可能的解决方案是:
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: