My question raised because I have read some online resources, that claimed that Event-Driven Architecture seems better then using REST https://solace.com/blog/experience-awesomeness-event-driven-microservices/
So I try to re-design my Rest based application to implement some messaging system, but I am not sure how can it work with MVC
when each services use Rest-API to communicate, then the structure like:
HTML view -> MVC controller -> controller send request Service A -> Service A return response to controller -> HTML view
but if I tried implement publish-subscribe (I am using Spring Cloud Stream and Kafka), I do not understand how can my "correct" user can receive the response. because I think when there are 2 different users:
Please see the image, I am not sure how, after my controller receive the message from the topic, can route to the correct user. I tried to use "consumer group" but it seems not the solution because it can only specific which "service instance" to handle the message, but here, my MVC application is the service instance but with different connections (different user)
I have tried my best to explain my problem, I am not good in English, please let me know if you need me to express more.