2

Is it possible to have an ASP.NET MVC Server that communicates with other MVC.net Applications? ( example is shown in image link )

Example enter image description here

A client first communicates with the Main Server. The Main Server redirects his request to one of the other Servers. The client can't communicate directly with the other servers. It should always be via the Main Server.

So when a user requests MainServer.com

MainServer will direct the user to either on of the following:
S1.MainServer.com
S2.MainServer.com
S3.MainServer.com

Note S1, S2 and S3 are physically separated from each other.

Meer
  • 2,765
  • 2
  • 19
  • 28
Eyadkht
  • 81
  • 7
  • There are lots of ways to do server-server communications. One server could make an HTTP request to another, message queuing, data in the database, … What works for a specific case depends on the details of the functional and non-functional requirements as well as available infrastructure. – Richard Feb 01 '17 at 08:57
  • For sure. I'd look at either a service bus in the background (like EasyNetQ, MassTransit or Azure SB), or Web API's, but it's hard to say without knowing what you're trying to accomplish. – Wiebe Tijsma Feb 01 '17 at 09:03
  • May be a load balancer can do this for you easily. – Thangadurai Feb 01 '17 at 10:17

1 Answers1

0

Try this:

public ActionResult Index()
{
    if (!S1.Server.IsBusy())
    {
        return new RedirectResult("http://S1.MainServer.com");
    }
    else if(!S2.Server.IsBusy())
    {
        return new RedirectResult("http://S2.MainServer.com");
    }
    else if (!S3.Server.IsBusy())
    {
        return new RedirectResult("http://S3.MainServer.com");
    }
    else return View();
}
derloopkat
  • 6,232
  • 16
  • 38
  • 45