Closed raikasdev closed 2 years ago
I found the answer from the Discord server!
The solution was to create a own queue for every microservice (and and a own event bus). https://github.com/rittaschool/ritta-server/commit/b837fd9f73a3d1163c02c2b5aef6102c5acb2334
I found the answer from the Discord server!
The solution was to create a own queue for every microservice (and and a own event bus). rittaschool/ritta@b837fd9
Would you please elaborate on this?
What do you mean by event bus
?
Client proxies, like here: https://github.com/rittaschool/ritta/blob/b837fd9f73a3d1163c02c2b5aef6102c5acb2334/apps/auth/src/main.ts#L29
Client proxies, like here: https://github.com/rittaschool/ritta/blob/b837fd9f73a3d1163c02c2b5aef6102c5acb2334/apps/auth/src/main.ts#L29
Thanks for your reply, I actually created a reproducable repository for my problem https://github.com/jtutxtiiddtieitxiexutusetu/to-demonstrate-the-error-nestjs-rabbitmq-microservice
Would you please test it and find where the problem is? I have spent quite some time but have not been able to find the source of problem. Events are being sent but I keep getting There is no matching event handler defined in the remote service. Event pattern: one_sent
for no reason.
I can ignore this error, yes, but I might predict that future inconsistencies may arise!
Thanks for your help.
I found the answer from the Discord server!
The solution was to create a own queue for every microservice (and and a own event bus). rittaschool/ritta@b837fd9
If every microservice has its own queue then how are they able to emit events to each other? There is no documentation on event bus in Nest.js unfortunately....
I've even tested the entire test codebase ( https://github.com/jtutxtiiddtieitxiexutusetu/to-demonstrate-the-error-nestjs-rabbitmq-microservice ) on the chaifeng/ubuntu-22.04-docker-20.10.17
vagrant box (I suspected my ubuntu is faulty), and the problem still persists!
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.
Is there an existing issue for this?
Current behavior
Currently every other request works, and every other is being marked as "Unroutable (drop)" by RabbitMQ and responding with "There is no matching message handler defined in the remote service.".
Minimum reproduction code
https://github.com/rittaschool/ritta-server
Steps to reproduce
./update.sh
docker-compose -f docker-compose.dev.yml up
users:users
andauth:auth
Expected behavior
The list of users should be sent every time.
Package
Other package
No response
NestJS version
8.2.4
Packages versions
Node.js version
16.13.1
In which operating systems have you tested?
Other
Authentication part of the application works fine without this problem. I am pretty sure that the problem lies somewhere inside the apps/users part of the repository.