Spend AMQP Messages from ASP.net MVC 4 with RabbitMQ

Let's say that I want to use AMQP messages from ASP.net MVC 4 using RabbitMQ. I store an object in System.Web.HttpContext.Current.Application, which internally uses a BackgroundWorker instance to listen for messages (a listener is created in Global.asax.cs)

Is this a good way to implement this operation, or should I use the static / singleton class? I'm inexperienced in ASP.net MVC, so I'm not sure. Maybe ASP.net MVC 4 is not the best platform? What would you recommend?

The goal is to track / record message traffic, kill / create / tune consumers as you wish from the web interface.

This is my first stackoverflow post since I believe in good research. But this time I would like to hear from other people: thanks :)

+5
source share
1 answer

ASP.NET application makes a poor subscriber RabbitMQ in my opinion. You are much better off implementing your subscriber as a Windows service.

  • This excellent post from Phil Haack provides some good reasons why you should think twice about using BackgroundWorker for any serious service.
  • This means that you can monitor and maintain your subscriber regardless of your web application. You can use all the ready-made tools that you get - task monitor, perf monitor - to understand how your service works.
  • -. -, . .
+4

All Articles