Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
fetch-depth: 0
-
name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'
-
name: Run tests
run: dotnet test --framework net9.0
run: dotnet test --framework net10.0
-
name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: 3.8
-
name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
-
name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
-
name: Run tests
run: dotnet test --framework net9.0
run: dotnet test --framework net10.0
-
name: Publish test results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ jobs:
dotnet-version: |
8.0
9.0
-
name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.0
dotnet-quality: 'preview'
-
name: Login to Docker Hub
if: ${{ github.event.pull_request.head.repo.fork == false }}
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="FluentValidation" Version="12.0.0" />
<PackageVersion Include="KurrentDB.Client" Version="1.2.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsVer)" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsVer)" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="$(MicrosoftExtensionsVer)" />
Expand Down
182 changes: 91 additions & 91 deletions Eventuous.slnx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion samples/esdb/Bookings.Payments/Bookings.Payments.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ItemGroup>
<ProjectReference Include="$(SrcRoot)\Extensions\src\Eventuous.Extensions.AspNetCore\Eventuous.Extensions.AspNetCore.csproj"/>
<ProjectReference Include="$(SrcRoot)\Extensions\src\Eventuous.Extensions.DependencyInjection\Eventuous.Extensions.DependencyInjection.csproj"/>
<ProjectReference Include="$(SrcRoot)\EventStore\src\Eventuous.EventStore\Eventuous.EventStore.csproj"/>
<ProjectReference Include="..\..\..\src\KurrentDb\src\Eventuous.KurrentDB\Eventuous.KurrentDB.csproj" />
<ProjectReference Include="$(SrcRoot)\Mongo\src\Eventuous.Projections.MongoDB\Eventuous.Projections.MongoDB.csproj"/>
<ProjectReference Include="$(SrcRoot)\Diagnostics\src\Eventuous.Diagnostics.OpenTelemetry\Eventuous.Diagnostics.OpenTelemetry.csproj"/>
<ProjectReference Include="$(SrcRoot)\Gateway\src\Eventuous.Gateway\Eventuous.Gateway.csproj"/>
Expand Down
12 changes: 6 additions & 6 deletions samples/esdb/Bookings.Payments/Integration/Payments.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Bookings.Payments.Domain;
using Eventuous;
using Eventuous.EventStore.Producers;
using Eventuous.KurrentDB.Producers;
using Eventuous.Gateway;
using Eventuous.Subscriptions.Context;
using static Bookings.Payments.Integration.IntegrationEvents;
Expand All @@ -11,16 +11,16 @@ namespace Bookings.Payments.Integration;
public static class PaymentsGateway {
static readonly StreamName Stream = new("PaymentsIntegration");

public static ValueTask<GatewayMessage<EventStoreProduceOptions>[]> Transform(IMessageConsumeContext original) {
public static ValueTask<GatewayMessage<KurrentDbProduceOptions>[]> Transform(IMessageConsumeContext original) {
var result = original.Message is PaymentEvents.PaymentRecorded evt
? new GatewayMessage<EventStoreProduceOptions>(
? new GatewayMessage<KurrentDbProduceOptions>(
Stream,
new BookingPaymentRecorded(original.Stream.GetId(), evt.BookingId, evt.Amount, evt.Currency),
new Metadata(),
new EventStoreProduceOptions()
new(),
new()
)
: null;
GatewayMessage<EventStoreProduceOptions>[] gatewayMessages = result != null ? [result] : [];
GatewayMessage<KurrentDbProduceOptions>[] gatewayMessages = result != null ? [result] : [];
return ValueTask.FromResult(gatewayMessages);
}
}
Expand Down
14 changes: 7 additions & 7 deletions samples/esdb/Bookings.Payments/Registrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using Bookings.Payments.Infrastructure;
using Bookings.Payments.Integration;
using Eventuous.Diagnostics.OpenTelemetry;
using Eventuous.EventStore;
using Eventuous.EventStore.Producers;
using Eventuous.EventStore.Subscriptions;
using Eventuous.KurrentDB;
using Eventuous.KurrentDB.Producers;
using Eventuous.KurrentDB.Subscriptions;
using Eventuous.Projections.MongoDB;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
Expand All @@ -15,15 +15,15 @@ namespace Bookings.Payments;

public static class Registrations {
public static void AddServices(this IServiceCollection services, IConfiguration configuration) {
services.AddEventStoreClient(configuration["EventStore:ConnectionString"]!);
services.AddEventStore<EsdbEventStore>();
services.AddKurrentDBClient(configuration["EventStore:ConnectionString"]!);
services.AddEventStore<KurrentDBEventStore>();
services.AddCommandService<CommandService, PaymentState>();
services.AddSingleton(Mongo.ConfigureMongo(configuration));
services.AddCheckpointStore<MongoCheckpointStore>();
services.AddProducer<EventStoreProducer>();
services.AddProducer<KurrentDbProducer>();

services
.AddGateway<AllStreamSubscription, AllStreamSubscriptionOptions, EventStoreProducer, EventStoreProduceOptions>(
.AddGateway<AllStreamSubscription, AllStreamSubscriptionOptions, KurrentDbProducer, KurrentDbProduceOptions>(
"IntegrationSubscription",
PaymentsGateway.Transform
);
Expand Down
2 changes: 1 addition & 1 deletion samples/esdb/Bookings/Bookings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SrcRoot)\Diagnostics\src\Eventuous.Diagnostics.Logging\Eventuous.Diagnostics.Logging.csproj"/>
<ProjectReference Include="$(SrcRoot)\EventStore\src\Eventuous.EventStore\Eventuous.EventStore.csproj"/>
<ProjectReference Include="..\..\..\src\KurrentDb\src\Eventuous.KurrentDB\Eventuous.KurrentDB.csproj" />
<ProjectReference Include="$(SrcRoot)\Experimental\src\Eventuous.Spyglass\Eventuous.Spyglass.csproj"/>
<ProjectReference Include="$(SrcRoot)\Extensions\src\Eventuous.Extensions.DependencyInjection\Eventuous.Extensions.DependencyInjection.csproj"/>
<ProjectReference Include="$(SrcRoot)\Mongo\src\Eventuous.Projections.MongoDB\Eventuous.Projections.MongoDB.csproj"/>
Expand Down
118 changes: 60 additions & 58 deletions samples/esdb/Bookings/Registrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Bookings.Integration;
using Eventuous;
using Eventuous.Diagnostics.OpenTelemetry;
using Eventuous.EventStore;
using Eventuous.EventStore.Subscriptions;
using Eventuous.KurrentDB;
using Eventuous.KurrentDB.Subscriptions;
using Eventuous.Projections.MongoDB;
using Eventuous.Subscriptions.Registrations;
using MongoDB.Driver.Core.Extensions.DiagnosticSources;
Expand All @@ -21,70 +21,72 @@
namespace Bookings;

public static class Registrations {
public static void AddEventuous(this IServiceCollection services, IConfiguration configuration) {
DefaultEventSerializer.SetDefaultSerializer(
new DefaultEventSerializer(new JsonSerializerOptions(JsonSerializerDefaults.Web).ConfigureForNodaTime(DateTimeZoneProviders.Tzdb))
);
extension(IServiceCollection services) {
public void AddEventuous(IConfiguration configuration) {
DefaultEventSerializer.SetDefaultSerializer(
new DefaultEventSerializer(new JsonSerializerOptions(JsonSerializerDefaults.Web).ConfigureForNodaTime(DateTimeZoneProviders.Tzdb))
);

services.AddEventStoreClient(configuration["EventStore:ConnectionString"]!);
services.AddEventStore<EsdbEventStore>();
services.AddCommandService<BookingsCommandService, BookingState>();
services.AddKurrentDBClient(configuration["EventStore:ConnectionString"]!);
services.AddEventStore<KurrentDBEventStore>();
services.AddCommandService<BookingsCommandService, BookingState>();

services.AddSingleton<Services.IsRoomAvailable>((_, _) => new(true));
services.AddSingleton<Services.ConvertCurrency>((from, currency) => new Money(from.Amount * 2, currency));
services.AddSingleton<Services.IsRoomAvailable>((_, _) => new(true));
services.AddSingleton<Services.ConvertCurrency>((from, currency) => new Money(from.Amount * 2, currency));

services.AddSingleton(Mongo.ConfigureMongo(configuration));
services.AddSingleton(Mongo.ConfigureMongo(configuration));

services.AddSubscription<AllStreamSubscription, AllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
.UseCheckpointStore<MongoCheckpointStore>()
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>()
.WithPartitioningByStream(2)
);
services.AddSingleton<BookingsQueryService>();
services.AddSubscription<AllStreamSubscription, AllStreamSubscriptionOptions>(
"BookingsProjections",
builder => builder
.UseCheckpointStore<MongoCheckpointStore>()
.AddEventHandler<BookingStateProjection>()
.AddEventHandler<MyBookingsProjection>()
.WithPartitioningByStream(2)
);
services.AddSingleton<BookingsQueryService>();

services.AddSubscription<StreamPersistentSubscription, StreamPersistentSubscriptionOptions>(
"PaymentIntegration",
builder => builder
.Configure(x => x.StreamName = PaymentsIntegrationHandler.Stream)
.AddEventHandler<PaymentsIntegrationHandler>()
);
}
services.AddSubscription<StreamPersistentSubscription, StreamPersistentSubscriptionOptions>(
"PaymentIntegration",
builder => builder
.Configure(x => x.StreamName = PaymentsIntegrationHandler.Stream)
.AddEventHandler<PaymentsIntegrationHandler>()
);
}

public static void AddTelemetry(this IServiceCollection services) {
var otelEnabled = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") != null;
public void AddTelemetry() {
var otelEnabled = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") != null;

services.AddOpenTelemetry()
.WithMetrics(
builder => {
builder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
.AddAspNetCoreInstrumentation()
.AddEventuous()
.AddEventuousSubscriptions()
.AddPrometheusExporter();
if (otelEnabled) builder.AddOtlpExporter();
}
);
services.AddOpenTelemetry()
.WithMetrics(
builder => {
builder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
.AddAspNetCoreInstrumentation()
.AddEventuous()
.AddEventuousSubscriptions()
.AddPrometheusExporter();
if (otelEnabled) builder.AddOtlpExporter();
}
);

services.AddOpenTelemetry()
.WithTracing(
builder => {
builder
.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddEventuousTracing()
.AddSource(typeof(DiagnosticsActivityEventSubscriber).Assembly.GetName().Name!)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
.SetSampler(new AlwaysOnSampler());
services.AddOpenTelemetry()
.WithTracing(
builder => {
builder
.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddEventuousTracing()
.AddSource(typeof(DiagnosticsActivityEventSubscriber).Assembly.GetName().Name!)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
.SetSampler(new AlwaysOnSampler());

if (otelEnabled)
builder.AddOtlpExporter();
else
builder.AddZipkinExporter();
}
);
if (otelEnabled)
builder.AddOtlpExporter();
else
builder.AddZipkinExporter();
}
);
}
}
}
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<CoreRoot>$(SrcRoot)\Core\src</CoreRoot>
<CoreTestRoot>$(SrcRoot)\Core\test</CoreTestRoot>
<DiagRoot>$(SrcRoot)\Diagnostics\src</DiagRoot>
<EsdbRoot>$(SrcRoot)\EventStore\src</EsdbRoot>
<KurrentDBRoot>$(SrcRoot)\KurrentDB\src</KurrentDBRoot>
<ExtRoot>$(SrcRoot)\Extensions\src</ExtRoot>
<GatewayRoot>$(SrcRoot)\Shovel\src</GatewayRoot>
<LocalRoot>..\..\src</LocalRoot>
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions src/EventStore/src/Eventuous.EventStore/README.md

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions src/Experimental/src/ElasticPlayground/CombinedStore.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using EventStore.Client;
using Eventuous.ElasticSearch.Store;
using Eventuous.EventStore;
using Eventuous.KurrentDB;
using Eventuous.Sut.App;
using Eventuous.Sut.Domain;
using KurrentDB.Client;
using Nest;
using static Eventuous.Sut.App.Commands;

Expand All @@ -13,9 +13,9 @@ public class CombinedStore {
readonly EsdbEventStore _esdbEventStore;
readonly ElasticEventStore _elasticEventStore;

public CombinedStore(IElasticClient elasticClient, EventStoreClient eventStoreClient) {
public CombinedStore(IElasticClient elasticClient, KurrentDBClient kurrentDbClient) {
_elasticEventStore = new(elasticClient);
_esdbEventStore = new(eventStoreClient);
_esdbEventStore = new(kurrentDbClient);
_store = new(_esdbEventStore, _elasticEventStore);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Experimental/src/ElasticPlayground/ConnectorAndArchive.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using EventStore.Client;
using Eventuous.ElasticSearch.Store;
using Eventuous.EventStore;
using Eventuous.KurrentDB;
using Eventuous.Sut.App;
using Eventuous.Sut.Domain;
using KurrentDB.Client;
using Nest;
using static Eventuous.Sut.App.Commands;

Expand All @@ -13,9 +13,9 @@ public class ConnectorAndArchive {
readonly ElasticEventStore _elasticEventStore;
readonly TieredEventStore _tieredStore;

public ConnectorAndArchive(IElasticClient elasticClient, EventStoreClient eventStoreClient) {
public ConnectorAndArchive(IElasticClient elasticClient, KurrentDBClient kurrentDbClient) {
_elasticEventStore = new(elasticClient);
_esdbEventStore = new(eventStoreClient);
_esdbEventStore = new(kurrentDbClient);
_tieredStore = new(_esdbEventStore, _elasticEventStore);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<IncludeSutApp>true</IncludeSutApp>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(EsdbRoot)\Eventuous.EventStore\Eventuous.EventStore.csproj" />
<ProjectReference Include="$(KurrentDBRoot)\Eventuous.KurrentDB\Eventuous.KurrentDB.csproj" />
<ProjectReference Include="..\Eventuous.ElasticSearch\Eventuous.ElasticSearch.csproj" />
<Using Include="Eventuous" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bogus" />
<PackageReference Include="NodaTime.Bogus" />
<PackageReference Include="EventStore.Client.Grpc.Streams" />
<PackageReference Include="KurrentDB.Client" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" />
</ItemGroup>
</Project>
Loading
Loading