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
14 changes: 7 additions & 7 deletions FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="SecurityService.Client" Version="2025.5.2-build82" />
<PackageReference Include="Shared" Version="2025.6.2" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.6.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="SecurityService.Client" Version="2025.7.1" />
<PackageReference Include="Shared" Version="2025.7.9" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.7.9" />
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Shared.EventStore" Version="2025.6.2" />
<PackageReference Include="Shared.EventStore" Version="2025.7.9" />
<PackageReference Include="System.IO.Abstractions" Version="22.0.14" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.2-build186" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.5.2-build186" />
<PackageReference Include="TransactionProcessor.Database" Version="2025.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions FileProcessor.Client/FileProcessor.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2025.6.2" />
<PackageReference Include="Shared.Results" Version="2025.6.2" />
<PackageReference Include="ClientProxyBase" Version="2025.7.9" />
<PackageReference Include="Shared.Results" Version="2025.7.9" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.6.2" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.7.9" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.6.2" />
<PackageReference Include="Shared.EventStore" Version="2025.6.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.7.9" />
<PackageReference Include="Shared.EventStore" Version="2025.7.9" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.6.2" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="2025.7.9" />
</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.71.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Shared.EventStore" Version="2025.6.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Shared.EventStore" Version="2025.7.9" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Shared.IntegrationTesting" Version="2025.6.2" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.2-build186" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.7.9" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="EventStoreProjections" Version="2023.12.3" />
<PackageReference Include="MessagingService.IntegrationTesting.Helpers" Version="2025.3.2-build77" />
<PackageReference Include="MessagingService.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.59" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
Expand All @@ -22,13 +22,13 @@
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="Reqnroll" Version="2.4.1" />
<PackageReference Include="Reqnroll.NUnit" Version="2.4.1" />
<PackageReference Include="SecurityService.Client" Version="2025.5.2-build82" />
<PackageReference Include="SecurityService.IntegrationTesting.Helpers" Version="2025.5.2-build82" />
<PackageReference Include="Shared" Version="2025.6.2" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.6.2" />
<PackageReference Include="SecurityService.Client" Version="2025.7.1" />
<PackageReference Include="SecurityService.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="Shared" Version="2025.7.9" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.7.9" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.2-build186" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.2-build186" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion FileProcessor.Tests/FileProcessor.Tests.csproj
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.14.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="22.0.14" />
Expand Down
24 changes: 7 additions & 17 deletions FileProcessor/Bootstrapper/ClientRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace FileProcessor.Bootstrapper;
using ClientProxyBase;

namespace FileProcessor.Bootstrapper;

using System;
using System.Diagnostics.CodeAnalysis;
Expand All @@ -18,26 +20,14 @@ public class ClientRegistry : ServiceRegistry
/// Initializes a new instance of the <see cref="ClientRegistry"/> class.
/// </summary>
public ClientRegistry() {
this.AddSingleton<ISecurityServiceClient, SecurityServiceClient>();
this.AddSingleton<ITransactionProcessorClient, TransactionProcessorClient>();
this.AddHttpContextAccessor();
this.RegisterHttpClient<ISecurityServiceClient, SecurityServiceClient>();
this.RegisterHttpClient<ITransactionProcessorClient, TransactionProcessorClient>();

//this.AddSingleton<Func<String, String>>(container => serviceName => { return ConfigurationReader.GetBaseServerUri(serviceName).OriginalString; });
Func<String, String> resolver(IServiceProvider container) => serviceName => { return ConfigurationReader.GetBaseServerUri(serviceName).OriginalString; };
Func<String, String> resolver1() => serviceName => { return ConfigurationReader.GetBaseServerUri(serviceName).OriginalString; };

this.AddSingleton<Func<String, String>>(resolver);

SocketsHttpHandler httpMessageHandler = new SocketsHttpHandler {
SslOptions = {
RemoteCertificateValidationCallback = (sender,
certificate,
chain,
errors) => true,
}
};

HttpClient httpClient = new(httpMessageHandler);
this.AddSingleton(httpClient);
this.AddSingleton<Func<String, String>>(resolver);
}

#endregion
Expand Down
7 changes: 4 additions & 3 deletions FileProcessor/FileProcessor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2025.7.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
<PackageReference Include="Lamar" Version="15.0.0" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="15.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
Expand All @@ -18,12 +19,12 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Shared" Version="2025.6.2" />
<PackageReference Include="Shared" Version="2025.7.9" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
<PackageReference Include="Shared.Results.Web" Version="2025.6.2" />
<PackageReference Include="Shared.Results.Web" Version="2025.7.9" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.3" />
Expand Down
27 changes: 22 additions & 5 deletions FileProcessor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Shared.Middleware;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FileProcessor
{
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Abstractions;
using System.Net.Http;
using BusinessLogic.Managers;
using EventStore.Client;
using File.DomainEvents;
using FileImportLog.DomainEvents;
using Lamar.Microsoft.DependencyInjection;
using MediatR;
using Microsoft.Extensions.DependencyInjection;
using NLog;
using NLog.Extensions.Logging;
using Shared.EventStore.EventHandling;
using Shared.Logger;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Abstractions;
using System.Net.Http;

[ExcludeFromCodeCoverage]
public class Program
Expand All @@ -41,13 +44,27 @@ public static IHostBuilder CreateHostBuilder(string[] args)
.AddJsonFile("hosting.development.json", optional: true)
.AddEnvironmentVariables().Build();

String contentRoot = Directory.GetCurrentDirectory();
String nlogConfigPath = Path.Combine(contentRoot, "nlog.config");

LogManager.Setup(b =>
{
b.SetupLogFactory(setup =>
{
setup.AddCallSiteHiddenAssembly(typeof(NlogLogger).Assembly);
setup.AddCallSiteHiddenAssembly(typeof(Shared.Logger.Logger).Assembly);
setup.AddCallSiteHiddenAssembly(typeof(TenantMiddleware).Assembly);
});
b.LoadConfigurationFromFile(nlogConfigPath);
});

IHostBuilder hostBuilder = Host.CreateDefaultBuilder(args);
hostBuilder.UseWindowsService();
hostBuilder.UseLamar();
hostBuilder.ConfigureLogging(logging =>
{
logging.AddConsole();

logging.AddNLog();
});
hostBuilder.ConfigureWebHostDefaults(webBuilder =>
{
Expand Down
13 changes: 1 addition & 12 deletions FileProcessor/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,19 @@ public static void LoadDomainEventsTypeDynamically(List<string> assemblyFilters
// 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)
{
String nlogConfigFilename = "nlog.config";

if (env.IsDevelopment())
{
var developmentNlogConfigFilename = "nlog.development.config";
if (System.IO.File.Exists(Path.Combine(env.ContentRootPath, developmentNlogConfigFilename)))
{
nlogConfigFilename = developmentNlogConfigFilename;
}

app.UseDeveloperExceptionPage();
}

loggerFactory.ConfigureNLog(Path.Combine(env.ContentRootPath, nlogConfigFilename));
loggerFactory.AddNLog();

ILogger logger = loggerFactory.CreateLogger("FileProcessor");

Logger.Initialise(logger);

Startup.Configuration.LogConfiguration(Logger.LogWarning);

ConfigurationReader.Initialise(Startup.Configuration);

app.UseMiddleware<TenantMiddleware>();
app.AddRequestLogging();
app.AddResponseLogging();
app.AddExceptionHandler();
Expand Down
2 changes: 1 addition & 1 deletion FileProcessor/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<target name="asyncFile" xsi:type="AsyncWrapper">
<target name="logfile" xsi:type="File"
fileName="/home/txnproc/trace/fileprocessor.log"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} |${mdlc:CorrelationId:fallback=NO-ID}| ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveFileName="/home/txnproc/trace/fileprocessor.{#####}.log"
archiveAboveSize="104857600"
archiveNumbering="Sequence"
Expand Down
Loading