title: Architecture for RabbitMQ in tandem with AngularJS/.NET Web API application
body: <p>So I have a SPA (single page application) with AngularJS as the front-end and .NET Web API the back-end (C#). I have a requirement to generate SQL Server Reporting Services (SSRS) reports upon some user action, i.e. select some data and press a button. Here is a rough illustration of my existing architecture:</p>
  
  <pre><code>FRONT END                 BACK END                  SSRS Report
  ==========                =========                 ===========
  **AngularJS Web page**--&gt;**.NET Web API controller**--&gt;**Intermediary class (passes arguments to report)** --&gt;**Generate report and save to file**
  </code></pre>
  
  <p>This works, but the problem is while the reports are being generated the application has to sit there and wait for them to finish and in the meantime the user can't do anything. If there are many reports to create, 100+ for example, it can take upwards of a minute or two, which is not acceptable for me.</p>
  
  <p>So this is where RabbitMQ comes in. The idea I have is for the .NET Web API controller to send a message to a server, once the server receives it a call is performed to the intermediary class above, which generates the report, then a response is sent back to the client letting them know the report has been generated. I think I would need to use the RPC scenario for that so I've done the corresponding tutorial on the RabbitMQ site and it seems straightforward enough.</p>
  
  <p>What I don't know though, and this is what my question is about, is how to start-up a client and a server from a .NET Web API application. Frankly I am a bit lost at the moment as this is my first real experience with any sort of messaging and I am not quite sure how to approach it, architecture wise. If I can get a detailed picture in my head of how the whole thing would work I can code it from there, but at this point I am having trouble visualizing how to structure the application.</p>
  
  <p>So, questions:</p>
  
  <ol>
  <li><p>How do i start a RabbitMQ server and client from a .NET Web API controller? Should the server and client be class libraries or console applications, or something else entirely?</p></li>
  <li><p>Is the architecture I am envisioning going to work or is there a better approach?</p></li>
  <li><p>Any general advice about how to approach what I am trying to accomplish would be appreciated.</p></li>
  </ol>