问题
I am creating an app, which will poll a rabbitmq queue for messages. I have three choices:
Console app, which listens for new messages
Windows service, which listens for new messages
Web API, which listens for new messages
In normal circumstances I would choose a windows service because it is a long running process and a TCP connection is available to the RabbitMQ server. However, how would this work if we decided to move the application to the cloud in future? The way that I understand it is that I can create a web job for a console app, however this is not possible for a windows service.
Q1) As I am thinking about the cloud, then should I be using a web api for this?
Q2) Is a console app more suitable than a windows service in the cloud?
I am specifically asking if the options I have chosen are available in the cloud.
来源:https://stackoverflow.com/questions/55039226/polling-in-the-cloud