Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP and gRPC client factory extension method to make using named endpoints easier #186

Closed
JamesNK opened this issue Sep 13, 2023 · 4 comments
Labels
area-service-discovery feature A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented Sep 13, 2023

Named endpoints design is ongoing, but one suggestion is to stash the name in the URL. Unfortunately, that makes the URL specified in user's apps rather ugly:

app.AddHttpClient<CatalogServiceClient>(c => c.BaseAddress = new("http://_http1.catalogservice"));
app.AddHttpClient<Greeter.GreetClient>(c => c.Address = new("http://_http2.catalogservice"));

A potential improvement is to add extension methods for HttpClientFactory and GrpcClientFactory that accepts address/name. The new methods would internally call AddHttpClient/AddGrpcClient and builds the ugly URL for the user:

app.AddHttpClient<CatalogServiceClient>(new("http://catalogservice"), name: "http1");
app.AddGrpcClient<Greeter.GreetClient>(new("http://catalogservice"), name: "http2");
@JamesNK
Copy link
Member Author

JamesNK commented Sep 13, 2023

Maybe: These methods internally call UseServiceDiscovery for the named client.

@davidfowl
Copy link
Member

davidfowl commented Sep 14, 2023

I'm assuming this shouldn't be app but a method hanging off IHttpClientBuilder. I'm not sure we want infinity overloads though.

@davidfowl
Copy link
Member

Move this to post preview @danmoseley

@danmoseley danmoseley added this to the some time after preview milestone Oct 9, 2023
@danmoseley danmoseley transferred this issue from another repository Oct 9, 2023
@danmoseley danmoseley added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Oct 12, 2023
@davidfowl davidfowl added area-service-discovery and removed area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Oct 16, 2023
@danmoseley danmoseley removed this from the needs milestone (for GA) milestone Nov 13, 2023
@davidfowl davidfowl added this to the Backlog milestone Jan 27, 2024
@davidfowl davidfowl added the feature A single user-facing feature. Can be grouped under an epic. label Sep 7, 2024
@maddymontaquila
Copy link
Member

We're closing this due to inactivity and also that we don't think we'll be ever prioritize - @JamesNK ping me and David if you want details LOL I do want this though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-service-discovery feature A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

4 participants