diff --git a/src/frontend/redirects.mjs b/src/frontend/redirects.mjs index b29475b1..7943f4ce 100644 --- a/src/frontend/redirects.mjs +++ b/src/frontend/redirects.mjs @@ -2,4 +2,5 @@ export const redirects = { // Docs redirects '/integrations/postgres': '/integrations/databases/postgres/', '/integrations/rabbitmq/': '/integrations/messaging/rabbitmq/', + '/integrations/eventstore/': '/integrations/databases/kurrentdb/', }; \ No newline at end of file diff --git a/src/frontend/scripts/update-integrations.js b/src/frontend/scripts/update-integrations.js index ccdaa068..57af6adb 100644 --- a/src/frontend/scripts/update-integrations.js +++ b/src/frontend/scripts/update-integrations.js @@ -14,7 +14,9 @@ const EXCLUDED_PACKAGES = [ 'Aspire.Hosting.IncrementalMigration', 'Aspire.Hosting.NodeJs', 'Aspire.MongoDB.Driver.v3', - 'Aspire.RabbitMQ.Client.v7' + 'Aspire.RabbitMQ.Client.v7', + 'CommunityToolkit.Aspire.Hosting.EventStore', + 'CommunityToolkit.Aspire.EventStore' ]; const OUTPUT_PATH = './src/data/aspire-integrations.json'; const OUTPUT_NAME_PATH = './src/data/aspire-integration-names.json'; diff --git a/src/frontend/sidebar.topics.ts b/src/frontend/sidebar.topics.ts index 3ea91744..1caf06aa 100644 --- a/src/frontend/sidebar.topics.ts +++ b/src/frontend/sidebar.topics.ts @@ -952,7 +952,6 @@ export const sidebarTopics: StarlightSidebarTopicsUserConfig = [ 'zh-CN': '数据库', }, items: [ { label: "Elasticsearch", slug: "integrations/databases/elasticsearch" }, - { label: "EventStore", slug: "integrations/databases/eventstore" }, { label: "KurrentDB", slug: "integrations/databases/kurrentdb" }, { label: "Meilisearch", slug: "integrations/databases/meilisearch" }, { label: "Milvus", slug: "integrations/databases/milvus" }, diff --git a/src/frontend/src/assets/icons/eventstore-icon.png b/src/frontend/src/assets/icons/eventstore-icon.png deleted file mode 100644 index 5e9f5872..00000000 Binary files a/src/frontend/src/assets/icons/eventstore-icon.png and /dev/null differ diff --git a/src/frontend/src/components/IntegrationGrid.astro b/src/frontend/src/components/IntegrationGrid.astro index 8b74768d..7960d0a2 100644 --- a/src/frontend/src/components/IntegrationGrid.astro +++ b/src/frontend/src/components/IntegrationGrid.astro @@ -40,7 +40,6 @@ import denoLightIcon from "@assets/icons/deno-light-icon.png"; import devTunnelsIcon from "@assets/icons/dev-tunnels-icon.svg"; import dockerIcon from "@assets/icons/docker.svg"; import elasticIcon from "@assets/icons/elastic-icon.png"; -import eventStoreIcon from "@assets/icons/eventstore-icon.png"; import flagDIcon from "@assets/icons/flagd-icon.svg"; import flagDLightIcon from "@assets/icons/flagd-light-icon.svg"; import garnetIcon from "@assets/icons/garnet-icon.png"; @@ -179,7 +178,6 @@ const icons = [ { meta: devTunnelsIcon, alt: "Dev Tunnels", search: "devtunnels" }, { meta: dockerIcon, alt: "Docker", search: "docker" }, { meta: elasticIcon, alt: "Elasticsearch", search: "elasticsearch" }, - { meta: eventStoreIcon, alt: "EventStore", search: "eventstore" }, { meta: flagDIcon, alt: "flagd", search: "flagd", light: flagDLightIcon }, { meta: garnetIcon, alt: "Garnet", search: "garnet" }, { meta: goIcon, alt: "Go", search: "golang gofeature", light: goLightIcon }, diff --git a/src/frontend/src/content/docs/integrations/databases/eventstore.mdx b/src/frontend/src/content/docs/integrations/databases/eventstore.mdx deleted file mode 100644 index c8b3b7d6..00000000 --- a/src/frontend/src/content/docs/integrations/databases/eventstore.mdx +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: EventStore integration -description: Learn how to use the EventStore integration, which includes both hosting and client integrations. ---- - -import { Aside } from '@astrojs/starlight/components'; -import { Badge } from '@astrojs/starlight/components'; -import InstallPackage from '@components/InstallPackage.astro'; -import InstallDotNetPackage from '@components/InstallDotNetPackage.astro'; -import { Image } from 'astro:assets'; -import eventstoreIcon from '@assets/icons/eventstore-icon.png'; - - - -EventStore logo - -[EventStore](https://eventstore.com) is a database designed for Event Sourcing, offering high availability and reliability for storing events. The Aspire EventStore integration enables you to connect to existing EventStore instances or create new instances from Aspire using the `docker.io/eventstore/eventstore` container image. - -## Hosting integration - -To run the EventStore container, install the [📦 CommunityToolkit.Aspire.Hosting.EventStore](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.EventStore) NuGet package in the AppHost project. - - - -### Add EventStore resource - -In the AppHost project, register and consume the EventStore integration using the `AddEventStore` extension method to add the EventStore container to the application builder. - -```csharp title="C# — AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var eventstore = builder.AddEventStore("eventstore"); - -builder.AddProject() - .WithReference(eventstore); - -// After adding all resources, run the app... -``` - -### Add EventStore resource with data volume - -To add a data volume to the EventStore resource, call the `WithDataVolume` method: - -```csharp title="C# — AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var eventstore = builder.AddEventStore("eventstore") - .WithDataVolume(); - -builder.AddProject() - .WithReference(eventstore); - -// After adding all resources, run the app... -``` - -The data volume is used to persist the EventStore data outside the lifecycle of its container. The data volume is mounted at the `/var/lib/eventstore` path in the EventStore container. - -### Add EventStore resource with data bind mount - -To add a data bind mount to the EventStore resource, call the `WithDataBindMount` method: - -```csharp title="C# — AppHost.cs" -var builder = DistributedApplication.CreateBuilder(args); - -var eventstore = builder.AddEventStore("eventstore") - .WithDataBindMount(source: @"C:\EventStore\Data"); - -builder.AddProject() - .WithReference(eventstore); - -// After adding all resources, run the app... -``` - -Data bind mounts rely on the host machine's filesystem to persist the EventStore data across container restarts. - -## Client integration - -To get started with the Aspire EventStore client integration, install the [📦 CommunityToolkit.Aspire.EventStore](https://nuget.org/packages/CommunityToolkit.Aspire.EventStore) NuGet package in the client-consuming project. - - - -### Add EventStore client - -In the `Program.cs` file of your client-consuming project, call the `AddEventStoreClient` extension method to register an `EventStoreClient` for use via the dependency injection container. The method takes a connection name parameter. - -```csharp -builder.AddEventStoreClient(connectionName: "eventstore"); -``` - - - -You can then retrieve the `EventStoreClient` instance using dependency injection: - -```csharp -public class ExampleService(EventStoreClient client) -{ - // Use client... -} -``` - -### Add keyed EventStore client - -There might be situations where you want to register multiple `EventStoreClient` instances with different connection names. To register keyed EventStore clients, call the `AddKeyedEventStoreClient` method: - -```csharp -builder.AddKeyedEventStoreClient(name: "accounts"); -builder.AddKeyedEventStoreClient(name: "orders"); -``` - -Then you can retrieve the `EventStoreClient` instances using dependency injection: - -```csharp -public class ExampleService( - [FromKeyedServices("accounts")] EventStoreClient accountsClient, - [FromKeyedServices("orders")] EventStoreClient ordersClient) -{ - // Use clients... -} -``` - -### Configuration - -The Aspire EventStore client integration provides multiple options to configure the server connection. - -#### Use a connection string - -When using a connection string from the `ConnectionStrings` configuration section, provide the name of the connection string: - -```csharp -builder.AddEventStoreClient("eventstore"); -``` - -Then the connection string will be retrieved from the `ConnectionStrings` configuration section: - -```json -{ - "ConnectionStrings": { - "eventstore": "esdb://localhost:22113?tls=false" - } -} -``` - -#### Use configuration providers - -The Aspire EventStore Client integration supports configuration. It loads the settings from configuration using the `Aspire:EventStore:Client` key: - -```json -{ - "Aspire": { - "EventStore": { - "Client": { - "ConnectionString": "esdb://localhost:22113?tls=false", - "DisableHealthChecks": true - } - } - } -} -``` - -### Client integration health checks - -The Aspire EventStore integration uses the configured client to perform a health check. - -## See also - -- [EventStore](https://eventstore.com) -- [EventStore Client](https://github.com/EventStore/EventStore-Client-Dotnet) -- [Aspire Community Toolkit GitHub repo](https://github.com/CommunityToolkit/Aspire)