在ASP.NET MVC上使用RabbitMQ [英] Using RabbitMQ at ASP.NET MVC
问题描述
客户端使用iOS应用+ RabbitMQ在服务器上发送消息.
Clients use iOS app + RabbitMQ to send messages on the server.
卖家使用ASP.NET MVC网站.
Sellers use ASP.NET MVC web site.
如何使用RabbitMQ for ASP.NET MVC从服务器获取消息?
How can I use RabbitMQ for ASP.NET MVC to get messages from server?
如果我以控制器内的使用者身份订阅RabbitMQ频道,则此操作将无效,因为控制器会返回View且EventHanlder不会触发.
If I subscribe to RabbitMQ channel as consumer inside controller, this doesn't work because controller returns View and EventHanlder doesn't fire.
推荐答案
您可以在global.asax或启动程序或程序(如果有此自托管程序)中或者在启动时可以初始化的其他位置中,从Rabbitmq创建订阅和接收消息.在这种情况下,ASP.NET mvc无关紧要.
You can create subscribing and recieving message from rabbitmq in global.asax or startup or program (if this selfhost) or another place which can be initialized on start. ASP.NET mvc in this case doesn't matter.
这篇关于在ASP.NET MVC上使用RabbitMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!