diff --git a/.github/workflows/buildwindowsimage.yml b/.github/workflows/buildwindowsimage.yml index b175ada..e2d2f9f 100644 --- a/.github/workflows/buildwindowsimage.yml +++ b/.github/workflows/buildwindowsimage.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Install NET 9 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: '9.0.x' - - name: Get the version id: get_version uses: battila7/get-version-action@v2 diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml index 17c6ec7..a3ecc3c 100644 --- a/.github/workflows/createrelease.yml +++ b/.github/workflows/createrelease.yml @@ -5,7 +5,7 @@ on: types: [published] jobs: - buildlinux: + build: name: "Release" env: ASPNETCORE_ENVIRONMENT: "Production" @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Install NET 9 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: '9.0.x' - - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} @@ -77,8 +72,8 @@ jobs: dotnet nuget push Nugets/FileProcessor.Client.${{ steps.get_version.outputs.VERSION }}.nupkg --api-key ${{ secrets.PRIVATEFEED_APIKEY }} --source ${{ secrets.PRIVATEFEED_URL }} --skip-duplicate deploystaging: - runs-on: [stagingserver,linux] - needs: buildlinux + runs-on: [stagingserver,windows] + needs: build environment: staging name: "Deploy to Staging" @@ -87,77 +82,31 @@ jobs: uses: actions/download-artifact@v4.1.8 with: name: fileprocessor - path: /tmp/fileprocessor # Download to a temporary directory - - name: Remove existing service (if applicable) + - name: Remove existing Windows service run: | - SERVICE_NAME="fileprocessor" - if systemctl is-active --quiet "$SERVICE_NAME"; then - echo "Stopping existing service..." - sudo systemctl stop "$SERVICE_NAME" - fi - if systemctl is-enabled --quiet "$SERVICE_NAME"; then - echo "Disabling existing service..." - sudo systemctl disable "$SERVICE_NAME" - fi - if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then - echo "Removing existing service unit file..." - sudo rm "/etc/systemd/system/${SERVICE_NAME}.service" - sudo systemctl daemon-reload - fi - + $serviceName = "Transaction Processing - File Processor" + # Check if the service exists + if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) { + Stop-Service -Name $serviceName + sc.exe delete $serviceName + } + - name: Unzip the files run: | - sudo mkdir -p /opt/txnproc/transactionprocessing/fileprocessor - sudo unzip -o /tmp/fileprocessor/fileprocessor.zip -d /opt/txnproc/transactionprocessing/fileprocessor - - # IMPORTANT: Add a step to ensure the .NET runtime is installed on the server - # This assumes it's not already there. If your base image already has it, you can skip this. - - name: Install .NET Runtime - run: | - # Example for Ubuntu. Adjust based on your .NET version (e.g., 8.0, 7.0) - # and if you need the SDK or just the runtime. - # This uses Microsoft's package repository for the latest versions. - wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - sudo dpkg -i packages-microsoft-prod.deb - rm packages-microsoft-prod.deb - sudo apt update - sudo apt install -y aspnetcore-runtime-9.0 - - - name: Install and Start as a Linux service + Expand-Archive -Path fileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\fileprocessor" -Force + + - name: Install as a Windows service run: | - SERVICE_NAME="fileprocessor" - # The WorkingDirectory is crucial for .NET apps to find appsettings.json and other files - WORKING_DIRECTORY="/opt/txnproc/transactionprocessing/fileprocessor" - DLL_NAME="FileProcessor.dll" # Your application's DLL - SERVICE_DESCRIPTION="Transaction Processing - File Processor" - - # Create a systemd service file - echo "[Unit]" | sudo tee /etc/systemd/system/${SERVICE_NAME}.service - echo "Description=${SERVICE_DESCRIPTION}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "After=network.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "[Service]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - # IMPORTANT: Use 'dotnet' to run your DLL - echo "ExecStart=/usr/bin/dotnet ${WORKING_DIRECTORY}/${DLL_NAME}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "WorkingDirectory=${WORKING_DIRECTORY}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "Restart=always" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "User=youruser" # IMPORTANT: Change to a dedicated, less privileged user - echo "Group=yourgroup" # IMPORTANT: Change to a dedicated, less privileged group - echo "Environment=ASPNETCORE_ENVIRONMENT=Production" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service # Example - echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "[Install]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - - # Reload systemd, enable, and start the service - sudo systemctl daemon-reload - sudo systemctl enable "$SERVICE_NAME" - sudo systemctl start "$SERVICE_NAME" - sudo systemctl status "$SERVICE_NAME" --no-pager # For debugging/verification + $serviceName = "Transaction Processing - File Processor" + $servicePath = "C:\txnproc\transactionprocessing\fileprocessor\FileProcessor.exe" + + New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic + Start-Service -Name $serviceName deployproduction: - runs-on: [productionserver,linux] - needs: [buildlinux, deploystaging] + runs-on: [productionserver, windows] + needs: [build, deploystaging] environment: production name: "Deploy to Production" @@ -166,70 +115,24 @@ jobs: uses: actions/download-artifact@v4.1.8 with: name: fileprocessor - path: /tmp/fileprocessor # Download to a temporary directory - - name: Remove existing service (if applicable) + - name: Remove existing Windows service run: | - SERVICE_NAME="fileprocessor" - if systemctl is-active --quiet "$SERVICE_NAME"; then - echo "Stopping existing service..." - sudo systemctl stop "$SERVICE_NAME" - fi - if systemctl is-enabled --quiet "$SERVICE_NAME"; then - echo "Disabling existing service..." - sudo systemctl disable "$SERVICE_NAME" - fi - if [ -f "/etc/systemd/system/${SERVICE_NAME}.service" ]; then - echo "Removing existing service unit file..." - sudo rm "/etc/systemd/system/${SERVICE_NAME}.service" - sudo systemctl daemon-reload - fi - + $serviceName = "Transaction Processing - File Processor" + # Check if the service exists + if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) { + Stop-Service -Name $serviceName + sc.exe delete $serviceName + } + - name: Unzip the files run: | - sudo mkdir -p /opt/txnproc/transactionprocessing/fileprocessor - sudo unzip -o /tmp/fileprocessor/fileprocessor.zip -d /opt/txnproc/transactionprocessing/fileprocessor - - # IMPORTANT: Add a step to ensure the .NET runtime is installed on the server - # This assumes it's not already there. If your base image already has it, you can skip this. - - name: Install .NET Runtime - run: | - # Example for Ubuntu. Adjust based on your .NET version (e.g., 8.0, 7.0) - # and if you need the SDK or just the runtime. - # This uses Microsoft's package repository for the latest versions. - wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - sudo dpkg -i packages-microsoft-prod.deb - rm packages-microsoft-prod.deb - sudo apt update - sudo apt install -y aspnetcore-runtime-9.0 - - - name: Install and Start as a Linux service + Expand-Archive -Path fileprocessor.zip -DestinationPath "C:\txnproc\transactionprocessing\fileprocessor" -Force + + - name: Install as a Windows service run: | - SERVICE_NAME="fileprocessor" - # The WorkingDirectory is crucial for .NET apps to find appsettings.json and other files - WORKING_DIRECTORY="/opt/txnproc/transactionprocessing/fileprocessor" - DLL_NAME="FileProcessor.dll" # Your application's DLL - SERVICE_DESCRIPTION="Transaction Processing - File Processor" - - # Create a systemd service file - echo "[Unit]" | sudo tee /etc/systemd/system/${SERVICE_NAME}.service - echo "Description=${SERVICE_DESCRIPTION}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "After=network.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "[Service]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - # IMPORTANT: Use 'dotnet' to run your DLL - echo "ExecStart=/usr/bin/dotnet ${WORKING_DIRECTORY}/${DLL_NAME}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "WorkingDirectory=${WORKING_DIRECTORY}" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "Restart=always" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "User=youruser" # IMPORTANT: Change to a dedicated, less privileged user - echo "Group=yourgroup" # IMPORTANT: Change to a dedicated, less privileged group - echo "Environment=ASPNETCORE_ENVIRONMENT=Production" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service # Example - echo "" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "[Install]" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/${SERVICE_NAME}.service - - # Reload systemd, enable, and start the service - sudo systemctl daemon-reload - sudo systemctl enable "$SERVICE_NAME" - sudo systemctl start "$SERVICE_NAME" - sudo systemctl status "$SERVICE_NAME" --no-pager # For debugging/verification + $serviceName = "Transaction Processing - File Processor" + $servicePath = "C:\txnproc\transactionprocessing\fileprocessor\FileProcessor.exe" + + New-Service -Name $serviceName -BinaryPathName $servicePath -Description $serviceName -DisplayName $serviceName -StartupType Automatic + Start-Service -Name $serviceName diff --git a/.github/workflows/nightlybuild.yml b/.github/workflows/nightlybuild.yml index 1359c9d..b2db769 100644 --- a/.github/workflows/nightlybuild.yml +++ b/.github/workflows/nightlybuild.yml @@ -16,11 +16,6 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Install NET 9 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: '9.0.x' - - name: Set Up Variables run: echo "action_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV @@ -55,13 +50,7 @@ jobs: run: docker build . --file FileProcessor/Dockerfile --tag fileprocessor:latest - name: Run Integration Tests - run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" - - #- name: Run Integration Tests 1 - #run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=Nightly1 - - #- name: Run Integration Tests 2 - #run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=Nightly2 + run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" - uses: actions/upload-artifact@v4.4.0 if: ${{ failure() }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 343b672..383fb0b 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -16,11 +16,6 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: Install NET 9 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: '9.0.x' - - name: Echo vars run: | echo "CI is > ${CI}" @@ -45,12 +40,6 @@ jobs: - name: Run Integration Tests run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest - #- name: Run Integration Tests 1 - # run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest1 - - #- name: Run Integration Tests 2 - # run: dotnet test "FileProcessor.IntegrationTests\FileProcessor.IntegrationTests.csproj" --filter Category=PRTest2 - - uses: actions/upload-artifact@v4.4.0 if: ${{ failure() }} with: diff --git a/.github/workflows/pushtomain.yml b/.github/workflows/pushtomain.yml index 1887d52..b05d5fa 100644 --- a/.github/workflows/pushtomain.yml +++ b/.github/workflows/pushtomain.yml @@ -18,11 +18,6 @@ jobs: - uses: actions/checkout@v2.3.4 with: fetch-depth: 0 - - - name: Install NET 9 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: '9.0.x' - name: Restore Nuget Packages run: dotnet restore FileProcessor.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} diff --git a/FIleProcessor.Models/FIleProcessor.Models.csproj b/FIleProcessor.Models/FIleProcessor.Models.csproj index eb06d46..4bf9b57 100644 --- a/FIleProcessor.Models/FIleProcessor.Models.csproj +++ b/FIleProcessor.Models/FIleProcessor.Models.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 None diff --git a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj index ff23671..04bc736 100644 --- a/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj +++ b/FileProcessor.BusinessLogic.Tests/FileProcessor.BusinessLogic.Tests.csproj @@ -1,18 +1,18 @@  - net9.0 + net10.0 Full false - - - + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj b/FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj index 2342578..bbe3f5a 100644 --- a/FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj +++ b/FileProcessor.BusinessLogic/FileProcessor.BusinessLogic.csproj @@ -1,22 +1,22 @@  - net9.0 + net10.0 - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/FileProcessor.Client/FileProcessor.Client.csproj b/FileProcessor.Client/FileProcessor.Client.csproj index 7682a46..2669455 100644 --- a/FileProcessor.Client/FileProcessor.Client.csproj +++ b/FileProcessor.Client/FileProcessor.Client.csproj @@ -1,13 +1,13 @@  - net9.0 + net10.0 $(TargetsForTfmSpecificBuildOutput);IncludeP2PAssets - - + + diff --git a/FileProcessor.DataTransferObjects/FileProcessor.DataTransferObjects.csproj b/FileProcessor.DataTransferObjects/FileProcessor.DataTransferObjects.csproj index a745a64..e650fe2 100644 --- a/FileProcessor.DataTransferObjects/FileProcessor.DataTransferObjects.csproj +++ b/FileProcessor.DataTransferObjects/FileProcessor.DataTransferObjects.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 None diff --git a/FileProcessor.File.DomainEvents/FileProcessor.File.DomainEvents.csproj b/FileProcessor.File.DomainEvents/FileProcessor.File.DomainEvents.csproj index cf94eae..d51ca2f 100644 --- a/FileProcessor.File.DomainEvents/FileProcessor.File.DomainEvents.csproj +++ b/FileProcessor.File.DomainEvents/FileProcessor.File.DomainEvents.csproj @@ -1,12 +1,12 @@  - net9.0 + net10.0 None - + diff --git a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj index 7d11543..5f3ce5c 100644 --- a/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj +++ b/FileProcessor.FileAggregate.Tests/FileProcessor.FileAggregate.Tests.csproj @@ -1,13 +1,13 @@  - net9.0 + net10.0 None false - + diff --git a/FileProcessor.FileAggregate/FileProcessor.FileAggregate.csproj b/FileProcessor.FileAggregate/FileProcessor.FileAggregate.csproj index fb3b3c1..cb49ba2 100644 --- a/FileProcessor.FileAggregate/FileProcessor.FileAggregate.csproj +++ b/FileProcessor.FileAggregate/FileProcessor.FileAggregate.csproj @@ -1,14 +1,14 @@  - net9.0 + net10.0 - - - + + + diff --git a/FileProcessor.FileImportLog.DomainEvents/FileProcessor.FileImportLog.DomainEvents.csproj b/FileProcessor.FileImportLog.DomainEvents/FileProcessor.FileImportLog.DomainEvents.csproj index aa4d6a7..e4d030b 100644 --- a/FileProcessor.FileImportLog.DomainEvents/FileProcessor.FileImportLog.DomainEvents.csproj +++ b/FileProcessor.FileImportLog.DomainEvents/FileProcessor.FileImportLog.DomainEvents.csproj @@ -1,12 +1,12 @@  - net9.0 + net10.0 None - + diff --git a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj index 0bbdeee..b178467 100644 --- a/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj +++ b/FileProcessor.FileImportLogAggregate.Tests/FileProcessor.FileImportLogAggregate.Tests.csproj @@ -1,13 +1,13 @@  - net9.0 + net10.0 None false - + diff --git a/FileProcessor.FileImportLogAggregate/FileProcessor.FileImportLogAggregate.csproj b/FileProcessor.FileImportLogAggregate/FileProcessor.FileImportLogAggregate.csproj index 3cfd3bd..49aa220 100644 --- a/FileProcessor.FileImportLogAggregate/FileProcessor.FileImportLogAggregate.csproj +++ b/FileProcessor.FileImportLogAggregate/FileProcessor.FileImportLogAggregate.csproj @@ -1,13 +1,13 @@  - net9.0 + net10.0 - - + + diff --git a/FileProcessor.IntegrationTesting.Helpers/FileProcessor.IntegrationTesting.Helpers.csproj b/FileProcessor.IntegrationTesting.Helpers/FileProcessor.IntegrationTesting.Helpers.csproj index 17920ec..7e5a876 100644 --- a/FileProcessor.IntegrationTesting.Helpers/FileProcessor.IntegrationTesting.Helpers.csproj +++ b/FileProcessor.IntegrationTesting.Helpers/FileProcessor.IntegrationTesting.Helpers.csproj @@ -1,14 +1,14 @@  - net9.0 + net10.0 enable enable - - + + diff --git a/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj b/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj index b39ef49..f70f79b 100644 --- a/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj +++ b/FileProcessor.IntegrationTests/FileProcessor.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 false @@ -12,23 +12,23 @@ - - + + - - - + + + - - - - - - - + + + + + + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/FileProcessor.Testing/FileProcessor.Testing.csproj b/FileProcessor.Testing/FileProcessor.Testing.csproj index 1097054..1e294ef 100644 --- a/FileProcessor.Testing/FileProcessor.Testing.csproj +++ b/FileProcessor.Testing/FileProcessor.Testing.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 None diff --git a/FileProcessor.Tests/FileProcessor.Tests.csproj b/FileProcessor.Tests/FileProcessor.Tests.csproj index c367543..966a0bb 100644 --- a/FileProcessor.Tests/FileProcessor.Tests.csproj +++ b/FileProcessor.Tests/FileProcessor.Tests.csproj @@ -1,17 +1,17 @@  - net9.0 + net10.0 None false - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/FileProcessor/Bootstrapper/MiddlewareRegistry.cs b/FileProcessor/Bootstrapper/MiddlewareRegistry.cs index 13e6c00..dc5f7e3 100644 --- a/FileProcessor/Bootstrapper/MiddlewareRegistry.cs +++ b/FileProcessor/Bootstrapper/MiddlewareRegistry.cs @@ -1,4 +1,7 @@ -namespace FileProcessor.Bootstrapper +using KurrentDB.Client; +using Microsoft.OpenApi; + +namespace FileProcessor.Bootstrapper { using EventStore.Client; using Lamar; @@ -7,7 +10,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.IdentityModel.Tokens; - using Microsoft.OpenApi.Models; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Shared.Authorisation; @@ -33,7 +35,7 @@ public MiddlewareRegistry() { String eventStoreConnectionString = ConfigurationReader.GetValue("EventStoreSettings", "ConnectionString"); - EventStoreClientSettings eventStoreClientSettings = EventStoreClientSettings.Create(eventStoreConnectionString); + KurrentDBClientSettings eventStoreClientSettings = KurrentDBClientSettings.Create(eventStoreConnectionString); this.AddHealthChecks().AddEventStore(eventStoreClientSettings, userCredentials: eventStoreClientSettings.DefaultCredentials, diff --git a/FileProcessor/Bootstrapper/RepositoryRegistry.cs b/FileProcessor/Bootstrapper/RepositoryRegistry.cs index 9bbd6a8..16341c2 100644 --- a/FileProcessor/Bootstrapper/RepositoryRegistry.cs +++ b/FileProcessor/Bootstrapper/RepositoryRegistry.cs @@ -43,10 +43,10 @@ public RepositoryRegistry() String connectionString = Startup.Configuration.GetValue("EventStoreSettings:ConnectionString"); - this.AddEventStoreProjectionManagementClient(connectionString); - this.AddEventStorePersistentSubscriptionsClient(connectionString); + this.AddKurrentDBProjectionManagementClient(connectionString); + this.AddKurrentDBPersistentSubscriptionsClient(connectionString); - this.AddEventStoreClient(connectionString); + this.AddKurrentDBClient(connectionString); this.AddSingleton(); @@ -56,9 +56,7 @@ public RepositoryRegistry() this.AddSingleton(); - this.AddSingleton>(cont => (esConnString, cacheDuration) => { - return SubscriptionRepository.Create(esConnString, cacheDuration); - }); + this.AddSingleton>(cont => SubscriptionRepository.Create); } #endregion diff --git a/FileProcessor/Common/Extensions.cs b/FileProcessor/Common/Extensions.cs index 359788a..d4498b2 100644 --- a/FileProcessor/Common/Extensions.cs +++ b/FileProcessor/Common/Extensions.cs @@ -2,17 +2,10 @@ namespace FileProcessor.Common; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.IO.Abstractions; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; using EventStore.Client; using FileProcessor.BusinessLogic.Managers; using FileProcessor.Models; +using KurrentDB.Client; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -22,6 +15,14 @@ namespace FileProcessor.Common; using Shared.EventStore.SubscriptionWorker; using Shared.General; using Shared.Logger; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.IO.Abstractions; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; [ExcludeFromCodeCoverage] public static class Extensions @@ -31,7 +32,7 @@ public static IServiceCollection AddInSecureEventStoreClient( Uri address, Func? createHttpMessageHandler = null) { - return services.AddEventStoreClient((Action)(options => + return services.AddKurrentDBClient((Action)(options => { options.ConnectivitySettings.Address = address; options.ConnectivitySettings.Insecure = true; diff --git a/FileProcessor/Dockerfile b/FileProcessor/Dockerfile index dad7ba2..f917033 100644 --- a/FileProcessor/Dockerfile +++ b/FileProcessor/Dockerfile @@ -3,7 +3,7 @@ FROM stuartferguson/txnprocbase:latest AS base WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src COPY ["FileProcessor/NuGet.Config", "."] COPY ["FileProcessor/FileProcessor.csproj", "FileProcessor/"] diff --git a/FileProcessor/Dockerfilewindows b/FileProcessor/Dockerfilewindows index f694106..c4d09ce 100644 --- a/FileProcessor/Dockerfilewindows +++ b/FileProcessor/Dockerfilewindows @@ -2,7 +2,7 @@ FROM stuartferguson/txnprocbasewindows AS base USER ContainerAdministrator WORKDIR /app -FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0-windowsservercore-ltsc2022 AS build WORKDIR /src COPY ["FileProcessor/NuGet.Config", "."] COPY ["FileProcessor/FileProcessor.csproj", "FileProcessor/"] diff --git a/FileProcessor/FileProcessor.csproj b/FileProcessor/FileProcessor.csproj index ebb774b..e5dfd95 100644 --- a/FileProcessor/FileProcessor.csproj +++ b/FileProcessor/FileProcessor.csproj @@ -1,37 +1,37 @@  - net9.0 + net10.0 Linux - - + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + +