命令“symfony 控制台信使:失败:显示”不起作用

问题描述

framework:
    messenger:
        # Uncomment this (and the Failed transport below) to send Failed messages to this transport for later handling.
        # failure_transport: Failed

        transports:
            # https://symfony.com/doc/current/messenger.html#transport-configuration
            async: 
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    auto_setup: false
                    use_notify: true
                    check_delayed_interval: 60000
                retry_strategy:
                    max_retries: 3
                    multiplier: 2
            Failed: 
                dsn: 'doctrine://default?queue_name=Failed'
            # sync: 'sync://'

        routing:
            # Route your messages to the transports
            # 'App\Message\YourMessage': async
            App\Message\CommentMessage: async
  • Messenger 守护进程已启动
  • 但是当我运行以下命令时,我收到以下错误消息:
jpmena@jpmena-300E4A-300E5A-300E7A-3430EA-3530EA:~/CONSULTANT/FASTTRACK/DEV/guestbook$ symfony console messenger:Failed:show

                                                                      
  There are no commands defined in the "messenger:Failed" namespace.  
                                                                      
  Did you mean this?                                                  
      messenger                                                       
                                                                      

  • 我的配置有什么问题?

解决方法

我认为您忘记删除对“failure_transport”行的评论

framework:
    messenger:
        # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
        failure_transport: failed <-- remove comment here