Is it appropriate to use message queues for synchronous rpc calls via ajax

nickbw picture nickbw · Apr 2, 2014 · Viewed 13k times · Source

I have a web application that uses the jquery autocomplete plugin, which essentially sends via ajax a request containing text that has been typed into a textbox to our web server, once the web server receives this request, it is then handed off to rabbitmq.

I know that we do get benefits from using messaging, but it seems like using it for blocking rpc calls is a misuse and that something like WCF is far more appropriate in this instance, is this the case or is it considered acceptable architecture?

Answer

Sigi picture Sigi · Apr 3, 2014

It's possible to perform RPC synchronous requests with RabbitMQ. Here it's explained very well, with its drawback included! So it's considered an acceptable architecture. Discouraged, but acceptable whenever the synchronous response is mandatory.

As a possible counter-effect is that adding RabbitMQ in the middle, you will add some latency to the solution.

However you have the possibility to gain in terms of reliability, flexibility, scalability,...