Reputation: 41
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?.
Upvotes: 4
Views: 1807
Reputation: 51
There are numerous reasons for using Message Queues over asynchronous Web Services or REST communication patterns:
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.
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.
Upvotes: 4