Send messages from Node app to Symfony using RabbitMQ
Many applications needs to migrate from monothic to microservices architecture to stand for scalability .
I decided to expriment the symfony/messenger component to handle messenges sent from the Node App to Symfony using RabbitMQ.
1- I used RabbitMQ docker image :
This image contains enabled plugins such as rabbitmqAdmin .
2- I created a small node app to publish messages :
3- On the Symfony app side :
We need to install the messenger component and the amqp-messenger bridge :
4- Serialize the messages received by the Symfony worker :
At the first attemp , I had problems to serialize messages using the symfony serializer because eventually the node app don’t know the type of object (FQNC).
So I decided to implement a custom serializer and add it to the transport config :
5- Finally I created the message handler :
That’s all for my first medium article .
I hope that it will be published on the symfony website :D