Skip to content

Add http.sys delegation support#1556

Merged
Tratcher merged 19 commits into
dotnet:mainfrom
NGloreous:user/nglore/httpsys.delegation
Feb 18, 2022
Merged

Add http.sys delegation support#1556
Tratcher merged 19 commits into
dotnet:mainfrom
NGloreous:user/nglore/httpsys.delegation

Conversation

@NGloreous
Copy link
Copy Markdown
Contributor

@NGloreous NGloreous commented Feb 7, 2022

This PR fixes #1503 and adds support for delegating requests to other processes via the http.sys request delegation feature.

There are two main components added:

  • HttpSysDelegator- Delegates request and manages DelegationRule lifetime based on updates to cluster config. Destinations opt-in to delegation by adding a 'HttpSysQueueName' metadata entry defining the name of the http.sys queue to attach to.
  • HttpSysDelegatorMiddleware - Determines if the selected destination should use queue delegation or not. If so, invokes HttpSysDelegator to delegate the request.

Also included are UTs, a functional regression test, docs, and samples.

Comment thread src/ReverseProxy/Delegation/HttpSysDelegationMiddleware.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegationRuleManager.cs Outdated
Comment thread test/ReverseProxy.FunctionalTests/Common/HttpSysFactAttribute.cs Outdated
@Tratcher Tratcher added this to the YARP 1.1.0 milestone Feb 7, 2022
Copy link
Copy Markdown
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review.

Comment thread test/ReverseProxy.FunctionalTests/Common/HttpSysFactAttribute.cs Outdated
Comment thread samples/ReverseProxy.HttpSysDelegation.Sample/README.md
Comment thread src/ReverseProxy/Delegation/AppBuilderDelegationExtensions.cs
Comment thread src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs Outdated
Comment thread src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs Outdated
Comment thread src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs Outdated
Comment thread src/ReverseProxy/Management/ReverseProxyServiceCollectionExtensions.cs Outdated
Comment thread test/ReverseProxy.FunctionalTests/HttpSysDelegationTests.cs Outdated
Comment thread test/ReverseProxy.FunctionalTests/HttpSysDelegationTests.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegationMiddleware.cs Outdated
Comment thread samples/ReverseProxy.HttpSysDelegation.Sample/README.md Outdated
Comment thread samples/ReverseProxy.HttpSysDelegation.Sample/README.md Outdated
Comment thread src/ReverseProxy/Delegation/AppBuilderDelegationExtensions.cs Outdated
Comment thread samples/ReverseProxy.HttpSysDelegation.Sample/ReverseProxy/appsettings.json Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegationRuleManager.cs Outdated
Comment thread src/ReverseProxy/Delegation/IHttpSysDelegationRuleManager.cs Outdated
Comment thread src/ReverseProxy/Delegation/AppBuilderDelegationExtensions.cs Outdated
Comment thread src/ReverseProxy/Management/IReverseProxyBuilderExtensions.cs Outdated
Comment thread src/ReverseProxy/Delegation/IHttpSysDelegationRuleManager.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegationMiddleware.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegationRuleManager.cs Outdated
This moves more logic into the manager (now called the HttpSysDelegator)
related to acatual delegation. Also making change to support multiple
destinations with the same queue reference. A few other minor PR
feedback.
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs Outdated
Comment thread src/ReverseProxy/Management/IReverseProxyBuilderExtensions.cs Outdated
Comment thread src/ReverseProxy/Management/IReverseProxyBuilderExtensions.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs Outdated
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs
Comment thread src/ReverseProxy/Delegation/HttpSysDelegator.cs
Comment thread src/ReverseProxy/Management/IReverseProxyBuilderExtensions.cs Outdated
@Tratcher Tratcher enabled auto-merge (squash) February 18, 2022 18:53
@Tratcher
Copy link
Copy Markdown
Member

@NGloreous can you please file a follow up issue about how to handle the situation where the queue recipient goes away.

auto-merge was automatically disabled February 18, 2022 18:59

Head branch was pushed to by a user without write access

@Tratcher Tratcher enabled auto-merge (squash) February 18, 2022 19:01
@Tratcher Tratcher merged commit b9c13db into dotnet:main Feb 18, 2022
@MihaZupan MihaZupan modified the milestones: YARP 1.1.0, YARP 1.1.0-RC1 Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose Http.Sys fast delegation proxying

3 participants