I'm solving the communications between the microservices with messaging-architecture.
Let's say I have a tradition application, and there're User
, Post
Video
modules.
You can create the posts, videos with it, but before that, I need to convert the username to user ID.
Once I've split the modules to microservice, I cannot chain them together, we visit the microservices directly instead.
And if I want to convert an username to an ID,
I can call the User
service in the Post
service via Messaging, so far so good.
But here's the problem:
How do I receive the converted user ID? Send another message back to the
Post
service and continue the next step?What if I want to do this from the
Video
service? I'll need to make another function for it in theUser
service?
That will be a lot of the functions if I got more and more services right?
I think this is not how messaging architecture works, but I have no clue how to communicate with the other services without messaging.
(Or should I chain them together in the API Gateway so I don't need the messaging architecture?).