通过ajax使用消息队列进行同步rpc调用是否合适 [英] Is it appropriate to use message queues for synchronous rpc calls via ajax

查看:45
本文介绍了通过ajax使用消息队列进行同步rpc调用是否合适的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 jquery 自动完成插件的 Web 应用程序,它本质上是通过 ajax 向我们的 Web 服务器发送一个包含已键入文本框的文本的请求,一旦 Web 服务器收到此请求,它就会被移交给兔子

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.

我知道我们确实从使用消息传递中受益,但似乎使用它来阻止 rpc 调用是一种误用,并且像 WCF 这样的东西在这种情况下更合适,是这种情况还是被认为是可接受的架构?

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?

推荐答案

可以使用 RabbitMQ 执行 RPC 同步请求.这里 解释得很好,包括它的缺点!所以它被认为是一种可接受的架构.不鼓励,但只要同步响应是强制性的,就可以接受.

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.

一个可能的反作用是在中间添加 RabbitMQ,你会给解决方案增加一些延迟.

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,...

这篇关于通过ajax使用消息队列进行同步rpc调用是否合适的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆