G
G
grabbee2021-07-07 22:15:07
symfony
grabbee, 2021-07-07 22:15:07

How to use Symfony\Messenger without a framework?

I found an article https://medium.com/@dimitri.gritsajuk/symfony-mess...

But it's probably already out of date. I installed all the components but without the framework itself. symfony/dependency-injection symfony/config symfony/messenger symfony/amqp-messenger symfony/serializer symfony/yaml and others.

The container service is running. But when I call $this->messageBus->dispatch(new Message($var)); - Nothing happens. Returns an empty envelope. It seems to work, but no errors occur. I still don't understand how to fix this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
grabbee, 2021-07-08
@grabbee

The article describes everything correctly. There,
* Container->addCompilerPass(new MessengerPass()); is added to the container.
I just forgot to call the container compilation
* Container->compile();

S
Sergey Kashirskikh, 2021-12-22
@Russell-s-Teapot

Here, I wrote an article on this topic on Habré.
Everything is described in detail there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question