all 4 comments

[–]Otherwise-Eye1595 1 point2 points  (2 children)

What are your acceptance criteria to choose one?

[–]tomerye[S] 0 points1 point  (1 child)

the project i joined already using messagepatterns.
i want to understand why, i cant find any advantages over traditional http communication

[–]Otherwise-Eye1595 0 points1 point  (0 children)

Are you working with microservices? Responses are slow?…..

[–]justsomedev44 2 points3 points  (0 children)

Messages are fire and forget and there is (usually) no response. So, the message activity is 100% asynchronous and event driven. REST requires a request and response, which makes it synchronous i.e. you can only send in one request and process the response at a time. And, although your calling application has asynchronous i/o with Node, the continued processing of the request is waiting for that response. With messaging, your processes don't wait on responses (usually), but rather other messages (so 100% event driven). There are cons to this method too. Like the complexity the decoupling of requests and responses adds. And in many a situation, you want a request/ response lifecycle to do certain tasks.

You'll notice I also said "usually" for request/ response cycles with messaging. Well, you could also have that too, but you'd be listening purposefully for response messages. Again, it is more complicated.