| STT | Web Service | Message Queue | Notes |
| 1 | If the server fails the client must take responsibility to handle the error. | If the server fails, the queue persist the message (optionally, even if the machine shutdown). | + Some Message Queue: RabbitMQ, Beanstalkd,
ActiveMQ, IBM MQ Series, Tuxedo. + Web service: Restful, SOAP Service. |
| 2 | When the server is working again the client is responsible of resending it. | When the server is working again, it receives the pending message. | |
| 3 | If the server gives a response to the call and the client fails the operation is lost. | If the server gives a response to the call and the client fails, if the client didn't acknowledge the response the message is persisted. | |
| 4 | You don't have contention, that is: if million of clients call a web service on one server in a second, most probably your server will go down. | You have contention, you can decide how many requests are handled by the server (call it worker instead). | |
| 5 | You can expect an immediate response from the server, but you can handle asynchronous calls too. | You don't expect an immediate synchronous response, but you can implement/simulate synchronous calls. | |
| Enable send message to all subscribers. | |||
| Your resources exist until you delete them, which means you can view historical information long after the process and task complete. | |||
| Task that has multiple steps, without any extra complicated protocols. |
Think big, start small, move fast.
Nhận xét