Distributed architecture with MassTransit, RabbitMQ and SignalR
<p>I'm developing distributed application with help of <a href="http://masstransit-project.com/" rel="noreferrer">MassTransit</a> and <a href="https://www.rabbitmq.com/" rel="noreferrer">rabbitmq</a></p>

<p>I have to provide ability to generate report on a web page without page reloading by click on a button, also I should call a windows service for data preparation (The service handles each request for 30sek - 1min).      </p>

<p>My first try based on this sample: <a href="https://github.com/MassTransit/Sample-RequestResponse" rel="noreferrer">https://github.com/MassTransit/Sample-RequestResponse</a> </p>

<pre><code>    [HttpPost]
    public async Task&lt;HttpStatusCodeResult&gt; GenerateReport(string someJsonData)
    {    
        var serviceAddress = new Uri(ConfigurationManager.AppSettings["BaseLineRecordService"]);
        var client = this.Bus.CreateRequestClient&lt;ICreateReportRequest, ICreateReportResponse&gt;(serviceAddress, TimeSpan.FromHours(1));
        ICreateReportResponse response = await client.Request(new CreateReportRequest());
        reportHub.ShowRepordData(response); // Update data by SingleR
        return new HttpStatusCodeResult(200);
    }
</code></pre>

<p>But as I understand it' not a better approach, because I'm keeping connection during all data preparation.</p>

<p>I've read many articles and I have found three ways. Which way is preferred?</p>

<p>1) Like on this article <a href="http://www.maldworth.com/2015/07/19/signalrchat-with-masstransit-v3/" rel="noreferrer">http://www.maldworth.com/2015/07/19/signalrchat-with-masstransit-v3/</a> </p>

<p><a href="https://i.stack.imgur.com/lqgt7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lqgt7.png" alt="enter image description here"></a></p>

<p>2) As first but with Rest API calling instead of Consumers from IIS side</p>

<p><a href="https://i.stack.imgur.com/EGE5s.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EGE5s.png" alt="enter image description here"></a></p>

<p>3) Idea from this article <a href="http://weblog.west-wind.com/posts/2013/Sep/04/SelfHosting-SignalR-in-a-Windows-Service" rel="noreferrer">http://weblog.west-wind.com/posts/2013/Sep/04/SelfHosting-SignalR-in-a-Windows-Service</a></p>

<p><a href="https://i.stack.imgur.com/z6IGW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/z6IGW.png" alt="enter image description here"></a></p>