PHP 的同步 AMQP
PHP 能否像 RPC 服务一样对待 AMQP,发送消息并阻塞直到返回回复?是否有任何好的示例,是否有任何库以易于使用的方式包装此类功能?
我希望拥有代理消息传递系统的灵活性,但避免 Web 层需要了解其异步性质。
Can PHP treat AMQP like an RPC service, and send a message and block until a reply is returned? Are there any good examples of this, and do any libraries wrap such functionality up in an easy-to-use way?
I'd like to have the flexibility of a brokered messaging system, but shield the web tier from needing to know about its asynchronous nature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,绝对。看看 RPC 风格的请求如何在系统中流动:
这完全可以使用 AMQP 等异步消息系统来实现。您只需要自己进行 RPC 关联:
AMQP 代理RabbitMQ 提供在线文档说明如何做到这一点。
Sure, absolutely. Look at how an RPC-style request flows around a system:
That's completely implementable with an asynchronous message system like AMQP. You just need to do the RPC correlation yourself:
RabbitMQ, an AMQP broker, offers documentation online on how to do exactly this.