You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
We are using ASP.NET Core to expose various APIs. Some of the API endpoints do forward requests to downstream APIs our "gateway" is aware of. For those scenarios, we are using Yarps direct forwarding capability to forward requests.
We have a number of "scatter gather" scenarios where the request is sent to a number of identical "downstream" endpoints that return slices of the data that is then composed together on the "gateway" side of things to be returned to the caller. Given the flexibility of Yarp we started wondering if we could leverage the forwarder capability to build those scatter gather scenarios and wondered whether that would even be a good approach, a potential "misuse" or what other "simple" alternatives might be suitable.
When going the path of exploring the direct forwarding capability, we noticed that if we had the capability of cloning the HttpContext similar to what is done in SignalR the scatter gather scenario could look something like
I'm using JSON DOM to stitch stuff together loosely typed, but of course it would also be possible to use a strongly typed approach.
To achieve the cloning capability, we have copied the code from SignalR, removed the SignalR specific part from it and then started using that customized code in our spikes.
Describe the solution you'd like
A mechanism to clone HttpContext. For example, we could see this approach being freed from SignalR specific parts and moved to an HttpContext based utility and then SignalR could use that ability to clone contexts too and add the signalr specific parts after the clone.
Alternatives:
Using HttpClient manually
Additional context
I wasn't entirely sure whether I should open it here or in the reverse proxy repository. I decided to put it here because the ability to clone HttpContext is already implemented internally in SignalR.
Yes we could look at GraphQL but we felt that might be another bigger change that we are not sure yet is worth for our scope.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
We are using ASP.NET Core to expose various APIs. Some of the API endpoints do forward requests to downstream APIs our "gateway" is aware of. For those scenarios, we are using Yarps direct forwarding capability to forward requests.
We have a number of "scatter gather" scenarios where the request is sent to a number of identical "downstream" endpoints that return slices of the data that is then composed together on the "gateway" side of things to be returned to the caller. Given the flexibility of Yarp we started wondering if we could leverage the forwarder capability to build those scatter gather scenarios and wondered whether that would even be a good approach, a potential "misuse" or what other "simple" alternatives might be suitable.
When going the path of exploring the direct forwarding capability, we noticed that if we had the capability of cloning the HttpContext similar to what is done in SignalR the scatter gather scenario could look something like
and
I'm using JSON DOM to stitch stuff together loosely typed, but of course it would also be possible to use a strongly typed approach.
To achieve the cloning capability, we have copied the code from SignalR, removed the SignalR specific part from it and then started using that customized code in our spikes.
Describe the solution you'd like
A mechanism to clone HttpContext. For example, we could see this approach being freed from SignalR specific parts and moved to an HttpContext based utility and then SignalR could use that ability to clone contexts too and add the signalr specific parts after the clone.
Alternatives:
Additional context
I wasn't entirely sure whether I should open it here or in the reverse proxy repository. I decided to put it here because the ability to clone HttpContext is already implemented internally in SignalR.
Yes we could look at GraphQL but we felt that might be another bigger change that we are not sure yet is worth for our scope.
The text was updated successfully, but these errors were encountered: