Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message Queues over asynchronous web services

I have used web services(WCF with asynchronous callback). Now I am learning Messaging Queues. When we can prefer a Message Queue over Web service

For Example: If I implemented an Asynchronous web service(WCF with Async callback or Asynchronous REST service), I can request for something and in meanwhile I can continue with other operations. So when we can prefer Message Queue over async web service?.

like image 506
Santosh Avatar asked Sep 19 '25 08:09

Santosh


1 Answers

There are numerous reasons for using Message Queues over asynchronous Web Services or REST communication patterns:

  1. Decouple senders from consumers: Services sending data are not directly invoking consumers for the data, which decouple services from each other. This makes it easier to evolve the architecture down the road.
  2. Replaying failed transmission: As a result of sending services having to directly invoke consuming services, failed transmissions of data can be tricky to handle. Message queues persist messages even if individual services go down, which allows services to begin reading messages of the queue once the service is back up.

  3. Asynchronous Protocol: While you might be able to make asynchronous HTTP calls, message queues are asynchronous at a protocol level which make them lighter weight and more efficient in architectures in which a large volume of small messages are being exchanged.

Also be aware of some common misunderstandings when deciding to use between RESTful communication patterns and message queues.

like image 144
Muntazir Fadhel Avatar answered Sep 20 '25 23:09

Muntazir Fadhel