10000 [Messenger] Consuming messages from doctrine transport fails (exception thrown) · Issue #32738 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Messenger] Consuming messages from doctrine transport fails (exception thrown) #32738
Closed
@DenisMir

Description

@DenisMir

Symfony version(s) affected: 4.3.2

Description
I am trying to use the messenger component with the doctrine transport asynchronously.
I have activated the doctrine transport by MESSENGER_TRANSPORT_DSN=doctrine://default in the .env.local.
In the messenger config the transport is configured as well:

framework:
    messenger:
        transports:
            async: '%env(MESSENGER_TRANSPORT_DSN)%'
        routing:
            'App\Message\SomeNotification': async

When dispatching the message in the controller with $this->dispatchMessage(new SomeNotification('some content')); everything is fine. The table messenger_messages of the doctrine transport gets created automatically and the message is saved in the table.

When trying to consume the message with ./bin/console messenger:consume async I'm getting the following error:

 [Symfony\Component\Debug\Exception\FatalThrowableError]                                                                                                                                                                                                               
  Argument 2 passed to Symfony\Component\Messenger\Worker::__construct() must implement interface Symfony\Component\Messenger\MessageBusInterface, string given, called in ..../vendor/symfony/messenger/  
  Command/ConsumeMessagesCommand.php on line 190         

So the $routableBus in the Symfony\Component\Messenger\Command\ConsumeMessagesCommand is empty which leads to the crash when instantiating the Worker.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0