-
Notifications
You must be signed in to change notification settings - Fork 715
Closed
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packagesredisIssues related to redis integrationsIssues related to redis integrations
Description
See https://redis.io/docs/latest/operate/redisinsight/configuration/#:~:text=true-,Preconfigure%20database%20connections,-Redis%20Insight%20allows for this new feature.
Today we issue HTTP requests to the redis insights to configure the connection.
aspire/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs
Lines 247 to 270 in c0413ac
| builder.ApplicationBuilder.Eventing.Subscribe<ResourceReadyEvent>(resource, async (e, ct) => | |
| { | |
| var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); | |
| if (!redisInstances.Any()) | |
| { | |
| // No-op if there are no Redis resources present. | |
| return; | |
| } | |
| // Wait for all endpoints to be allocated before attempting to import databases | |
| await endpointsAllocatedTcs.Task.ConfigureAwait(false); | |
| var redisInsightResource = builder.ApplicationBuilder.Resources.OfType<RedisInsightResource>().Single(); | |
| var insightEndpoint = redisInsightResource.PrimaryEndpoint; | |
| using var client = new HttpClient(); | |
| client.BaseAddress = new Uri($"{insightEndpoint.Scheme}://{insightEndpoint.Host}:{insightEndpoint.Port}"); | |
| var rls = e.Services.GetRequiredService<ResourceLoggerService>(); | |
| var resourceLogger = rls.GetLogger(resource); | |
| await ImportRedisDatabases(resourceLogger, redisInstances, client, ct).ConfigureAwait(false); | |
| }); |
We should change over to the new feature so we can configure this like we do all the other "management" resource containers.
Metadata
Metadata
Assignees
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packagesredisIssues related to redis integrationsIssues related to redis integrations