如何获得一个工人的RabbitMQ通知我的手机前端? [英] How to get a RabbitMQ Worker to notify my Mobile Front End?

查看:620
本文介绍了如何获得一个工人的RabbitMQ通知我的手机前端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个移动应用程序发送到REST服务的请求。 REST服务将持续存在的数据,并创建RabbitMQ的请求。

I have a mobile application that sends a request to a REST service. The REST Service will persist the data and Create a Request in RabbitMQ.

在我的RabbitMQ消费者开始处理队列中的要求,我想以某种方式通知我的移动应用程序,请求正在处理中。

Once my RabbitMQ Consumer starts to process the request in the queue, I want to somehow notify my mobile application that the request is being processed.

请你能给我提供一些想法,我怎么能通知我的移动应用?

Please can you provide me with some ideas as to how I can notify my Mobile Application?

也许使用像SignalR?

Maybe using something like SignalR?

推荐答案

您需要将您的移动应用程序与REST服务器之间启用2路的消息,喜欢的东西SignalR。但你还需要REST服务器和处理实际工作的后端进程之间的双向通讯。

You need to have 2-way messaging enabled between your mobile app and the REST server, with something like SignalR. But you also need two way messaging between the REST server and the back-end process that handles the real work.

在该请求进入到REST服务器,发送跨向的RabbitMQ后端code的请求。其余的服务器也应设置为该正在做的工作地位队列的消费。

When the request comes in to the REST server, send the request across RabbitMQ to the back-end code. The REST server should also be set up as a consumer of a "status" queue for the work that is being done.

当一个消息进入状态队列,其余的服务器将更新它的数据库的当前工作状态。然后,它可以使用SignalR或Socket.IO或PusherApp或任何其他的WebSockets或要推送机制,并发送状态更新到所述移动设备

When a messages comes into the "status" queue, the REST server will update it's database with the current status of the work. It can then use SignalR or Socket.IO or PusherApp or whatever other websockets or push mechanism you want, and send that status update out to the mobile device.

这篇关于如何获得一个工人的RabbitMQ通知我的手机前端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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