dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
2.98k stars 281 forks source link

Introduction of Microsoft.Extensions.ServiceRegistration.* packages #3987

Open thompson-tomo opened 2 weeks ago

thompson-tomo commented 2 weeks ago

To facilitate a rich eco system which provides developers with a large amount of flexibility we should be releasing a service registration packages with the key ones being.

A potential usage would be as follows:

var builder = DistributedApplication.CreateBuilder(args).**AddAspireRegistry()**;

var cache = builder.AddRedis("cache");

var apiservice = builder.AddProject<Projects.AspireApp_ApiService>("apiservice");

builder.AddProject<Projects.AspireApp_Web>("webfrontend")
       .WithReference(cache)
       .WithReference(apiservice);

builder.Build()**.RegisterToRegistry()**.Run();

With this approach we can easily use aspire registry for local development & switch to alternative in production ie Kubernetes.

davidfowl commented 2 weeks ago

This API proposal is a little bit light on details for something that you'd like to see changed before GA @thompson-tomo . Unfortunately, I don't think we'd be making any huge changes this late without fully understanding the details and implications.

Can you help us by explaining in more details what this change would look like and what it would affect?

thompson-tomo commented 2 weeks ago

The key thing is the 2 additions to the code snippet above which was taken directly from the docs:

davidfowl commented 2 weeks ago

This sounds like a cool idea that needs some more design and iteration. It's not something we will add at this point without going through those design rounds.

thompson-tomo commented 2 weeks ago

Agree, it is not something for initial release given timeline and it would need detailed design in terms of interface shape etc with implications for a number of libraries.