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
In our server cluster setup, we need to dynamically select an endpoint based on the cluster information. This is pretty easy with Grpc.Net - throw in a custom HttpMessageHandler to modify the request message before it goes out.
Now for the wrinkle: The performance characteristics of HttpClient have improved dramatically for net5.0. But they are not there for net48 or netcoreapp3.1, so in that case we want to leverage the older c-based grpc bits. This means that the netstandard2.1 implementation is off the table.
I tested what happens and Grpc.Core only uses that parameter to change the request hostname header. It doesn't change the address or port that the request is sent to.
If so would you accept a PR to align the implementations?
HttpClient doesn't allow that header to be changed. HttpClient sets it for you based on the destination address.
Or is there another way to do this that works across all platforms?
I don't know. I'm not a Grpc.Core expert. Perhaps you should ask at grpc/grpc?
HttpClient doesn't allow that header to be changed. HttpClient sets it for you based on the destination address.
We have in the past used a custom HttpMessageHandler to override the destination address. However we have found a better way to do what we want - have one channel per address. Thanks anyway!
In our server cluster setup, we need to dynamically select an endpoint based on the cluster information. This is pretty easy with Grpc.Net - throw in a custom
HttpMessageHandler
to modify the request message before it goes out.Now for the wrinkle: The performance characteristics of
HttpClient
have improved dramatically fornet5.0
. But they are not there fornet48
ornetcoreapp3.1
, so in that case we want to leverage the older c-based grpc bits. This means that thenetstandard2.1
implementation is off the table.I see that Interceptors let you change the
host
(at least I assume so, can't find any docs on this). However I see that inHttpClientCallInvoker
that parameter is being ignored: https://github.com/grpc/grpc-dotnet/blob/8283efe58eb2cefc3635641e43410611ac13b436/src/Grpc.Net.Client/Internal/HttpClientCallInvoker.cs#L98|If possible I would prefer to have the host selection logic in one place, so my questions are:
The text was updated successfully, but these errors were encountered: