ASP.NET Core 6 has added support for a new Windows feature which allows a process to delegate processing of requests it receives to other request queues. This enables the ability to route requests based on any headers to other processes running on the same machine without adding significant latency to the overall processing of the request.
This repository provides a simple example of how to use queue delegation.
There are three sample applications in this repository. Two applications are just simple hello world applications and the third is an example of an application that uses the new HttpSys queue delegation feature.
This is a simple hello world ASP.NET Core application. It supports running within IIS and as a standalone console app.
This is a simple hello world ASP.NET Framework application. It supports running with IIS.
This application delegates requests to one or more other applications. Its behavior is to round robin requests between all the configured destinations which are specified in appsettings.json.
This is another example of a delegator application but it integrates with YARP to leverage its config and routing system and also supports a mix of queue delegation and proxying of request.
You need to install the .NET 6.0 SDK. To build in Visual Studio, you need use 2019 and make sure it’s up to date.
The delegator only works on versions of Windows that support queue delegation. At the time of writing this you’ll need to install a recent preview build.
You need to install the .NET 6.0 Runtime or the .NET Core Runtime Hosting Bundle if you want to run in IIS.
AspnetcoreHello.exe --urls http://*:7000
Follow these instructions to host an ASP.NET Core application in IIS. Set the site name to AspnetCoreHello and the port to 7001.
You need to have .NET Framework 4.7.2 or higher installed. Follow these instructions to host an ASP.NET Framework application in IIS. Set the site name to AspnetFrameworkHello and the port to 7002.
You need to install the .NET 6.0 Runtime.
NOTE: If you want to delegate to IIS applications, for now you will need to run the delegator as SYSTEM. You can use the trick here to do that.
Delegator.exe --urls http://+:5000
You need to install the .NET 6.0 Runtime.
NOTE: If you want to delegate to IIS applications, for now you will need to run the delegator as SYSTEM. You can use the trick here to do that.
Details on how to configure routes can be found here.
YarpDelegator.exe --urls http://+:5000