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
4 changes: 2 additions & 2 deletions .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
dotnet nuget push Nugets/MessagingService.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.EmailMessage.DomainEvents\MessagingService.EmailMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.EmailMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.SMSMessage.DomainEvents\MessagingService.SMSMessage.DomainEvents.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.SMSMessage.DomainEvents.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
dotnet pack "MessagingService.IntegrationTesting.Helpers\MessagingService.IntegrationTesting.Helpers.csproj" /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output Nugets -c Release
dotnet nuget push Nugets/MessagingService.IntegrationTesting.Helpers.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }}
2 changes: 1 addition & 1 deletion MessagingService.Client/MessagingService.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2024.4.1" />
<PackageReference Include="ClientProxyBase" Version="2024.4.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Shared.EventStore" Version="2024.4.1" />
<PackageReference Include="Shared.EventStore" Version="2024.4.2" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared" Version="2024.4.1" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2024.4.1" />
<PackageReference Include="Shared" Version="2024.4.2" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2024.4.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.61.0" />
<PackageReference Include="Shared" Version="2024.4.1" />
<PackageReference Include="Shared.EventStore" Version="2024.4.1" />
<PackageReference Include="Shared" Version="2024.4.2" />
<PackageReference Include="Shared.EventStore" Version="2024.4.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.IntegrationTesting" Version="2024.4.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2024.4.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2024.4.1" />
<PackageReference Include="ClientProxyBase" Version="2024.4.2" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.59" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Reqnroll.Tools.MsBuild.Generation" Version="1.0.1" />
<PackageReference Include="Reqnroll.xUnit" Version="1.0.1" />
<PackageReference Include="SecurityService.Client" Version="2024.3.1" />
<PackageReference Include="SecurityService.IntegrationTesting.Helpers" Version="2024.3.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2024.4.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2024.4.2" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
Expand All @@ -27,7 +27,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Messaging.IntegrationTesting.Helpers\MessagingService.IntegrationTesting.Helpers.csproj" />
<ProjectReference Include="..\MessagingService.Client\MessagingService.Client.csproj" />
<ProjectReference Include="..\MessagingService.DataTransferObjects\MessagingService.DataTransferObjects.csproj" />
<ProjectReference Include="..\MessagingService.IntegrationTesting.Helpers\MessagingService.IntegrationTesting.Helpers.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="2024.4.1" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2024.4.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.61.0" />
<PackageReference Include="Shared.EventStore" Version="2024.4.1" />
<PackageReference Include="Shared.EventStore" Version="2024.4.2" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions MessagingService/Bootstrapper/MiddlewareRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@
using Microsoft.OpenApi.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Shared.EventStore.EventStore;
using Shared.EventStore.Extensions;
using Shared.General;
using Swashbuckle.AspNetCore.Filters;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.Configuration;

[ExcludeFromCodeCoverage]
public class MiddlewareRegistry : ServiceRegistry
{
public MiddlewareRegistry() {

String connectionString = Startup.Configuration.GetValue<String>("EventStoreSettings:ConnectionString");
EventStoreClientSettings eventStoreConnectionSettings = EventStoreClientSettings.Create(connectionString);

this.AddHealthChecks()
.AddEventStore(Startup.EventStoreClientSettings,
.AddEventStore(eventStoreConnectionSettings,
name: "Eventstore",
failureStatus: HealthStatus.Unhealthy,
tags: new string[] { "db", "eventstore" });
Expand Down
28 changes: 4 additions & 24 deletions MessagingService/Bootstrapper/RepositoryRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,12 @@ public RepositoryRegistry()
}
else
{
Boolean insecureES = Startup.Configuration.GetValue<Boolean>("EventStoreSettings:Insecure");
String connectionString = Startup.Configuration.GetValue<String>("EventStoreSettings:ConnectionString");

Func<SocketsHttpHandler> CreateHttpMessageHandler = () => new SocketsHttpHandler
{
SslOptions = new SslClientAuthenticationOptions
{
RemoteCertificateValidationCallback = (sender,
certificate,
chain,
errors) => {
return true;
}
}
};
this.AddEventStoreProjectionManagementClient(connectionString);
this.AddEventStorePersistentSubscriptionsClient(connectionString);

this.AddEventStoreProjectionManagementClient(Startup.ConfigureEventStoreSettings);
this.AddEventStorePersistentSubscriptionsClient(Startup.ConfigureEventStoreSettings);

if (insecureES)
{
this.AddInSecureEventStoreClient(Startup.EventStoreClientSettings.ConnectivitySettings.Address, CreateHttpMessageHandler);
}
else
{
this.AddEventStoreClient(Startup.EventStoreClientSettings.ConnectivitySettings.Address, CreateHttpMessageHandler);
}
this.AddEventStoreClient(connectionString);

this.AddSingleton<IConnectionStringConfigurationRepository, ConfigurationReaderConnectionStringRepository>();
}
Expand Down
21 changes: 6 additions & 15 deletions MessagingService/Common/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Shared.EventStore.Aggregate;
using Shared.EventStore.EventHandling;
using Shared.EventStore.Extensions;
using Shared.EventStore.SubscriptionWorker;
Expand All @@ -19,19 +20,6 @@
[ExcludeFromCodeCoverage]
public static class Extensions
{
public static IServiceCollection AddInSecureEventStoreClient(
this IServiceCollection services,
Uri address,
Func<HttpMessageHandler>? createHttpMessageHandler = null)
{
return services.AddEventStoreClient((Action<EventStoreClientSettings>)(options =>
{
options.ConnectivitySettings.Address = address;
options.ConnectivitySettings.Insecure = true;
options.CreateHttpMessageHandler = createHttpMessageHandler;
}));
}

static Action<TraceEventType, String, String> log = (tt,
subType,
message) => {
Expand All @@ -58,7 +46,7 @@ public static IServiceCollection AddInSecureEventStoreClient(

public static void PreWarm(this IApplicationBuilder applicationBuilder)
{
Startup.LoadTypes();
TypeProvider.LoadDomainEventsTypeDynamically();

IConfigurationSection subscriptionConfigSection = Startup.Configuration.GetSection("AppSettings:SubscriptionConfiguration");
SubscriptionWorkersRoot subscriptionWorkersRoot = new SubscriptionWorkersRoot();
Expand All @@ -74,9 +62,12 @@ public static void PreWarm(this IApplicationBuilder applicationBuilder)

Func<String, Int32, ISubscriptionRepository> subscriptionRepositoryResolver = Startup.Container.GetInstance<Func<String, Int32, ISubscriptionRepository>>();


String connectionString = Startup.Configuration.GetValue<String>("EventStoreSettings:ConnectionString");
EventStoreClientSettings eventStoreConnectionSettings = EventStoreClientSettings.Create(connectionString);
applicationBuilder.ConfigureSubscriptionService(subscriptionWorkersRoot,
eventStoreConnectionString,
Startup.EventStoreClientSettings,
eventStoreConnectionSettings,
eventHandlerResolvers,
Extensions.log,
subscriptionRepositoryResolver,
Expand Down
2 changes: 1 addition & 1 deletion MessagingService/MessagingService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Shared" Version="2024.4.1" />
<PackageReference Include="Shared" Version="2024.4.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
Expand Down
25 changes: 1 addition & 24 deletions MessagingService/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,7 @@ public Startup(IWebHostEnvironment webHostEnvironment)
public static IConfigurationRoot Configuration { get; set; }

public static IWebHostEnvironment WebHostEnvironment { get; set; }

internal static EventStoreClientSettings EventStoreClientSettings;

public static void LoadTypes()
{
RequestSentToEmailProviderEvent e = new RequestSentToEmailProviderEvent(Guid.Parse("2AA2D43B-5E24-4327-8029-1135B20F35CE"), "", new List<String>(),
"", "", true);

RequestSentToSMSProviderEvent s = new RequestSentToSMSProviderEvent(Guid.NewGuid(), "", "", "");

TypeProvider.LoadDomainEventsTypeDynamically();
}

public static void ConfigureEventStoreSettings(EventStoreClientSettings settings)
{
String connectionString = Startup.Configuration.GetValue<String>("EventStoreSettings:ConnectionString");

Startup.EventStoreClientSettings = EventStoreClientSettings.Create(connectionString); ;
}


public static Container Container;

public void ConfigureContainer(ServiceRegistry services)
Expand All @@ -82,11 +63,7 @@ public void ConfigureContainer(ServiceRegistry services)
services.IncludeRegistry<MessagingProxyRegistry>();

Startup.Container = new Container(services);

//Startup.ServiceProvider = services.BuildServiceProvider();
}

//public static IServiceProvider ServiceProvider { get; set; }

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
Expand Down