I have a simple solution with 3 projects:
- Asp.Net MVC4 Web app – the main website
- Console App – task runner
- Console App – task runner
I wish to use MassTrasnsit to serve as a queue so that actions on the website (like send email) do not block the website, instead being published to the queue and taken care by the task runners.
My question is: Where should I initialize the queue, the web app, one of the task runners or create a separate console app for that?
ps. The console apps will be windows services when running on production servers.
As creating the queue is a one-off operation and you will probably want to tweak the default permissions, it would be best to create the queue in advance using a separate console app. Note that the publisher (the web app) and the consumers (the task runners) need a queue each, and that if they are on different servers then you will need to create the queues on each server.