Where to initialize MassTransit in an Asp.Net MVC 4 application?

I have a simple solution with three projects:

  • Asp.Net MVC4 Web Application - Main Site
  • Console Application - Task Runner
  • Console Application - Task Runner

I want to use MassTrasnsit for the queue, so that actions on the website (for example, sending emails) do not block the website, but publish in the queue and take care of tasks.

My question is: Where should I initialize the queue, the web application, one of the participants in the tasks, or create a separate console application for it?

ps. Console applications will work with windows on production servers.

+4
source share
1 answer

Since creating a queue is a one-time action, and you probably want to set default permissions, it would be better to create a queue in advance using a separate console application. Please note that the publisher (web application) and consumers (task runners) need each queue, and if they are on different servers, you will need to create queues on each server.

+4
source

All Articles