From 0cbd14a0ebfeee817bb2e38f7deab0e95683b72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 27 Feb 2024 12:57:04 +0100 Subject: [PATCH 01/18] Prepare RTM --- .github/workflows/ci.yml | 1 - .github/workflows/release.yml | 1 - ...Bus.Storage.MongoDB.AcceptanceTests.csproj | 4 +- ...torage.MongoDB.NoTx.AcceptanceTests.csproj | 4 +- ...us.Storage.MongoDB.PersistenceTests.csproj | 4 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 6 +- .../TransactionSessionDefaultServer.cs | 23 +++--- ...ransactionalSession.AcceptanceTests.csproj | 6 +- ....MongoDB.TransactionalSession.Tests.csproj | 6 +- ...torage.MongoDB.TransactionalSession.csproj | 4 +- src/NServiceBus.Storage.MongoDB.sln | 4 +- .../Configuration/CompatibilitySettings.cs | 4 +- .../Configuration/MongoSettingsExtensions.cs | 14 ++-- .../NServiceBus.Storage.MongoDB.csproj | 10 ++- .../SynchronizedStorageSessionExtensions.cs | 2 +- .../Utils/Guard.cs | 81 ------------------- 16 files changed, 49 insertions(+), 125 deletions(-) delete mode 100644 src/NServiceBus.Storage.MongoDB/Utils/Guard.cs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e9b1418..cafc7ed9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.x - dotnet-quality: 'preview' - name: Build run: dotnet build src --configuration Release - name: Upload packages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc5cc0e3..6ed92d3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,6 @@ jobs: uses: actions/setup-dotnet@v4.0.0 with: dotnet-version: 8.0.x - dotnet-quality: 'preview' - name: Build run: dotnet build src --configuration Release - name: Sign NuGet packages diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index 01088a28..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index 01088a28..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index d8987433..5ac9f96f 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 348b5d28..924a2439 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,12 +11,12 @@ - - + + - \ No newline at end of file + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/Infrastructure/TransactionSessionDefaultServer.cs b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/Infrastructure/TransactionSessionDefaultServer.cs index 37fe0ecc..1885e803 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/Infrastructure/TransactionSessionDefaultServer.cs +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/Infrastructure/TransactionSessionDefaultServer.cs @@ -10,38 +10,39 @@ public class TransactionSessionDefaultServer : IEndpointSetupTemplate { - public virtual async Task GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, + public virtual async Task GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointCustomizations, Func configurationBuilderCustomization) { - var builder = new EndpointConfiguration(endpointConfiguration.EndpointName); - builder.EnableInstallers(); + var endpointConfiguration = new EndpointConfiguration(endpointCustomizations.EndpointName); - builder.Recoverability() + endpointConfiguration.EnableInstallers(); + endpointConfiguration.UseSerialization(); + endpointConfiguration.Recoverability() .Delayed(delayed => delayed.NumberOfRetries(0)) .Immediate(immediate => immediate.NumberOfRetries(0)); - builder.SendFailedMessagesTo("error"); + endpointConfiguration.SendFailedMessagesTo("error"); var storageDir = Path.Combine(Path.GetTempPath(), "learn", TestContext.CurrentContext.Test.ID); - builder.UseTransport(new AcceptanceTestingTransport + endpointConfiguration.UseTransport(new AcceptanceTestingTransport { StorageLocation = storageDir }); - var mongoSettings = builder.UsePersistence(); + var mongoSettings = endpointConfiguration.UsePersistence(); mongoSettings.EnableTransactionalSession(); mongoSettings.MongoClient(SetupFixture.MongoClient); mongoSettings.DatabaseName(SetupFixture.DatabaseName); mongoSettings.UseTransactions(true); - builder.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext)); + endpointConfiguration.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext)); - await configurationBuilderCustomization(builder).ConfigureAwait(false); + await configurationBuilderCustomization(endpointConfiguration).ConfigureAwait(false); // scan types at the end so that all types used by the configuration have been loaded into the AppDomain - builder.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass()); + endpointConfiguration.TypesToIncludeInScan(endpointCustomizations.GetTypesScopedByTestClass()); - return builder; + return endpointConfiguration; } } } \ No newline at end of file diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 4cd15f04..7414c147 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index c36e4cfd..e1e86721 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession/NServiceBus.Storage.MongoDB.TransactionalSession.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession/NServiceBus.Storage.MongoDB.TransactionalSession.csproj index 23308247..7f2680d5 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession/NServiceBus.Storage.MongoDB.TransactionalSession.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession/NServiceBus.Storage.MongoDB.TransactionalSession.csproj @@ -12,8 +12,8 @@ - + - \ No newline at end of file + diff --git a/src/NServiceBus.Storage.MongoDB.sln b/src/NServiceBus.Storage.MongoDB.sln index a22fcb35..94bc21ad 100644 --- a/src/NServiceBus.Storage.MongoDB.sln +++ b/src/NServiceBus.Storage.MongoDB.sln @@ -9,7 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Storage.MongoDB EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{204B96DD-7CDD-498E-B527-2CA09B17AD6D}" ProjectSection(SolutionItems) = preProject + ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml Custom.Build.props = Custom.Build.props + ..\.github\workflows\release.yml = ..\.github\workflows\release.yml EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Storage.MongoDB.AcceptanceTests", "NServiceBus.Storage.MongoDB.AcceptanceTests\NServiceBus.Storage.MongoDB.AcceptanceTests.csproj", "{6BCA8AC9-E4BC-4920-BA3F-C218708B8A6B}" @@ -22,7 +24,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Storage.MongoDB EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests", "NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests\NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj", "{704337C7-74B5-435A-88C7-AC0E10EA7795}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Storage.MongoDB.TransactionalSession.Tests", "NServiceBus.Storage.MongoDB.TransactionalSession.Tests\NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj", "{C9FA6374-432B-4E58-AC5C-7C86FEAA9256}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Storage.MongoDB.TransactionalSession.Tests", "NServiceBus.Storage.MongoDB.TransactionalSession.Tests\NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj", "{C9FA6374-432B-4E58-AC5C-7C86FEAA9256}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/NServiceBus.Storage.MongoDB/Configuration/CompatibilitySettings.cs b/src/NServiceBus.Storage.MongoDB/Configuration/CompatibilitySettings.cs index 001ef11e..b1b7a162 100644 --- a/src/NServiceBus.Storage.MongoDB/Configuration/CompatibilitySettings.cs +++ b/src/NServiceBus.Storage.MongoDB/Configuration/CompatibilitySettings.cs @@ -19,7 +19,7 @@ internal CompatibilitySettings(SettingsHolder settingsHolder) : base(settingsHol /// public CompatibilitySettings VersionElementName(string versionElementName) { - Guard.AgainstNullAndEmpty(nameof(versionElementName), versionElementName); + ArgumentException.ThrowIfNullOrWhiteSpace(versionElementName); this.GetSettings().Set(SettingsKeys.VersionElementName, versionElementName); return this; @@ -30,7 +30,7 @@ public CompatibilitySettings VersionElementName(string versionElementName) /// public CompatibilitySettings CollectionNamingConvention(Func collectionNamingConvention) { - Guard.AgainstNull(nameof(collectionNamingConvention), collectionNamingConvention); + ArgumentNullException.ThrowIfNull(collectionNamingConvention); this.GetSettings().Set(SettingsKeys.CollectionNamingConvention, collectionNamingConvention); return this; diff --git a/src/NServiceBus.Storage.MongoDB/Configuration/MongoSettingsExtensions.cs b/src/NServiceBus.Storage.MongoDB/Configuration/MongoSettingsExtensions.cs index b594002d..df4a93fc 100644 --- a/src/NServiceBus.Storage.MongoDB/Configuration/MongoSettingsExtensions.cs +++ b/src/NServiceBus.Storage.MongoDB/Configuration/MongoSettingsExtensions.cs @@ -15,8 +15,8 @@ public static class MongoSettingsExtensions /// public static PersistenceExtensions MongoClient(this PersistenceExtensions persistenceExtensions, IMongoClient mongoClient) { - Guard.AgainstNull(nameof(persistenceExtensions), persistenceExtensions); - Guard.AgainstNull(nameof(mongoClient), mongoClient); + ArgumentNullException.ThrowIfNull(persistenceExtensions); + ArgumentNullException.ThrowIfNull(mongoClient); persistenceExtensions.GetSettings().Set(SettingsKeys.MongoClient, () => mongoClient); return persistenceExtensions; @@ -27,8 +27,8 @@ public static PersistenceExtensions MongoClient(this Persisten /// public static PersistenceExtensions DatabaseName(this PersistenceExtensions persistenceExtensions, string databaseName) { - Guard.AgainstNull(nameof(persistenceExtensions), persistenceExtensions); - Guard.AgainstNullAndEmpty(nameof(databaseName), databaseName); + ArgumentNullException.ThrowIfNull(persistenceExtensions); + ArgumentException.ThrowIfNullOrWhiteSpace(databaseName); persistenceExtensions.GetSettings().Set(SettingsKeys.DatabaseName, databaseName); return persistenceExtensions; @@ -39,7 +39,7 @@ public static PersistenceExtensions DatabaseName(this Persiste /// public static PersistenceExtensions UseTransactions(this PersistenceExtensions persistenceExtensions, bool useTransactions) { - Guard.AgainstNull(nameof(persistenceExtensions), persistenceExtensions); + ArgumentNullException.ThrowIfNull(persistenceExtensions); persistenceExtensions.GetSettings().Set(SettingsKeys.UseTransactions, useTransactions); return persistenceExtensions; @@ -50,8 +50,8 @@ public static PersistenceExtensions UseTransactions(this Persi /// public static PersistenceExtensions TimeToKeepOutboxDeduplicationData(this PersistenceExtensions persistenceExtensions, TimeSpan timeToKeepOutboxDeduplicationData) { - Guard.AgainstNull(nameof(persistenceExtensions), persistenceExtensions); - Guard.AgainstNegativeAndZero(nameof(timeToKeepOutboxDeduplicationData), timeToKeepOutboxDeduplicationData); + ArgumentNullException.ThrowIfNull(persistenceExtensions); + ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(timeToKeepOutboxDeduplicationData, TimeSpan.Zero); var seconds = Math.Ceiling(timeToKeepOutboxDeduplicationData.TotalSeconds); diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 9cb2b2de..7cf27b4a 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,8 +5,8 @@ - - + + @@ -15,4 +15,8 @@ - \ No newline at end of file + + + + + diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorageSessionExtensions.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorageSessionExtensions.cs index 61de1df1..4cd9f6dc 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorageSessionExtensions.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorageSessionExtensions.cs @@ -21,7 +21,7 @@ public static IClientSessionHandle GetClientSession(this ISynchronizedStorageSes /// public static IMongoSynchronizedStorageSession MongoPersistenceSession(this ISynchronizedStorageSession session) { - Guard.AgainstNull(nameof(session), session); + ArgumentNullException.ThrowIfNull(session); if (session is IMongoSynchronizedStorageSession mongoSession) { diff --git a/src/NServiceBus.Storage.MongoDB/Utils/Guard.cs b/src/NServiceBus.Storage.MongoDB/Utils/Guard.cs deleted file mode 100644 index 25d1461a..00000000 --- a/src/NServiceBus.Storage.MongoDB/Utils/Guard.cs +++ /dev/null @@ -1,81 +0,0 @@ -namespace NServiceBus.Storage.MongoDB -{ - using System; - using System.Collections; - using System.Linq; - using System.Reflection; - - static class Guard - { - public static void TypeHasDefaultConstructor(Type type, string argumentName) - { - if (type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .All(ctor => ctor.GetParameters().Length != 0)) - { - var error = $"Type '{type.FullName}' must have a default constructor."; - throw new ArgumentException(error, argumentName); - } - } - - public static void AgainstNull(string argumentName, object value) - { - if (value == null) - { - throw new ArgumentNullException(argumentName); - } - } - - public static void AgainstNullAndEmpty(string argumentName, string value) - { - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentNullException(argumentName); - } - } - - public static void AgainstNullAndEmpty(string argumentName, ICollection value) - { - if (value == null) - { - throw new ArgumentNullException(argumentName); - } - - if (value.Count == 0) - { - throw new ArgumentOutOfRangeException(argumentName); - } - } - - public static void AgainstNegativeAndZero(string argumentName, int value) - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(argumentName); - } - } - - public static void AgainstNegative(string argumentName, int value) - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(argumentName); - } - } - - public static void AgainstNegativeAndZero(string argumentName, TimeSpan value) - { - if (value <= TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException(argumentName); - } - } - - public static void AgainstNegative(string argumentName, TimeSpan value) - { - if (value < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException(argumentName); - } - } - } -} \ No newline at end of file From fd98c7fcfc1937758676b987416d862ecdc7c084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 10:35:28 +0100 Subject: [PATCH 02/18] Improve ex message --- .../SynchronizedStorage/SynchronizedStorage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs index aae05d5d..1d3d2f8b 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs @@ -46,7 +46,7 @@ protected override void Setup(FeatureConfigurationContext context) // Without this check, exceptions will be thrown during message processing. if (clusterType is not ClusterType.ReplicaSet and not ClusterType.Sharded) { - throw new Exception($"Transactions are only supported on replica sets or sharded clusters. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'."); + throw new Exception($"Cluster type in use is {clusterType}, transactions are only supported on replica sets or sharded clusters. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'."); } try From e5b7753ce5c860c5c29a9a6bcf2482ee7f735b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 11:02:43 +0100 Subject: [PATCH 03/18] Try 7.2.1 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cafc7ed9..452e904e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: uses: Particular/setup-mongodb-action@v1.3.1 with: connection-string-name: NServiceBusStorageMongoDB_ConnectionString + mongodb-version: 7.2.1 mongodb-port: 27018 mongodb-replica-set: tr0 - name: Run tests From a22910e2eb43d8272e8dc9519e4c907830dbcddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 11:06:45 +0100 Subject: [PATCH 04/18] 7.0.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 452e904e..e4833ce1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: uses: Particular/setup-mongodb-action@v1.3.1 with: connection-string-name: NServiceBusStorageMongoDB_ConnectionString - mongodb-version: 7.2.1 + mongodb-version: 7.0.5 mongodb-port: 27018 mongodb-replica-set: tr0 - name: Run tests From eedd4695d36078242c380d3b1c6f00458f74d1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 11:58:00 +0100 Subject: [PATCH 05/18] Rollback to 2.19.2 --- .github/workflows/ci.yml | 1 - .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4833ce1..cafc7ed9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,6 @@ jobs: uses: Particular/setup-mongodb-action@v1.3.1 with: connection-string-name: NServiceBusStorageMongoDB_ConnectionString - mongodb-version: 7.0.5 mongodb-port: 27018 mongodb-replica-set: tr0 - name: Run tests diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index adf9e957..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index adf9e957..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index 5ac9f96f..ad39fe0d 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 924a2439..ad4fc51e 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 7414c147..b9cbcced 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index e1e86721..8420ae41 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 7cf27b4a..03f80708 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 5888187a5f6db15002ca7384e6d5d9ffb96e3a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 12:10:00 +0100 Subject: [PATCH 06/18] Try MongoDB.Driver 2.23.0 --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index 704d3fbf..2d3b2253 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index 704d3fbf..2d3b2253 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index ad39fe0d..b5d1a33c 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index ad4fc51e..8d82afe9 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index b9cbcced..5bd6decd 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 8420ae41..7101898f 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 03f80708..79b8c091 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From a0f1f1a747b2df480073247024ef5bd6bb43bd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 12:16:53 +0100 Subject: [PATCH 07/18] Try 2.22.0 --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index 2d3b2253..ff198e1c 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index 2d3b2253..ff198e1c 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index b5d1a33c..eedbdeda 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 8d82afe9..96b6e221 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 5bd6decd..925b6f4b 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 7101898f..ed130cea 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 79b8c091..37a25d58 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 207b1807dc3ebe1e5fc07c03298c127a66f037e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 28 Feb 2024 12:23:27 +0100 Subject: [PATCH 08/18] Try 2.20.0 --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index ff198e1c..d525a136 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index ff198e1c..d525a136 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index eedbdeda..74fb9e00 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 96b6e221..806f6512 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 925b6f4b..3f206250 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index ed130cea..50b255bc 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 37a25d58..f3a9ca1c 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 1cfecb1622885b5a3294754c3d0574b0ec9e9775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 29 Feb 2024 11:03:23 +0100 Subject: [PATCH 09/18] Go back to 2.19.2 --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index d525a136..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index d525a136..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index 74fb9e00..ad39fe0d 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 806f6512..ad4fc51e 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 3f206250..b9cbcced 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 50b255bc..8420ae41 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index f3a9ca1c..03f80708 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 729b356076baed13601f690f50eb0b4c476b3105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 14 Mar 2024 09:23:01 +0100 Subject: [PATCH 10/18] Do a fake list databases to ensure that cluster info is fetched --- .../SynchronizedStorage/SynchronizedStorage.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs index 1d3d2f8b..6c26ef4b 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs @@ -39,6 +39,8 @@ protected override void Setup(FeatureConfigurationContext context) { if (useTransactions) { + client.ListDatabases(); + var clusterType = client.Cluster.Description.Type; //HINT: cluster configuration check is needed as the built-in checks, executed during "StartTransaction() call, From b27ae23ff99e8a10b9efc70cdd82f64c214fbb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 27 Feb 2024 12:57:04 +0100 Subject: [PATCH 11/18] Prepare RTM --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ...torage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...rviceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 4 ++-- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index 704d3fbf..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index 704d3fbf..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index ad39fe0d..5ac9f96f 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index ad4fc51e..924a2439 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index b9cbcced..7414c147 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 8420ae41..91d45c96 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,11 +16,11 @@ - + - \ No newline at end of file + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 03f80708..7cf27b4a 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 3a76b22a1ff2bb5fb80d5df4a0d725f61b55f451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 8 Mar 2024 09:01:23 +0100 Subject: [PATCH 12/18] Cleanup --- .../NServiceBus.Storage.MongoDB.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 7cf27b4a..5d1d7b37 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -15,8 +15,4 @@ - - - - From 04930840af3a9db25c11400ca62a5f56a3b1e800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 8 Mar 2024 09:09:25 +0100 Subject: [PATCH 13/18] Revert to 2.19.2 --- .../NServiceBus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ....Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj | 2 +- ...ServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index adf9e957..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index adf9e957..704d3fbf 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index 5ac9f96f..ad39fe0d 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index 924a2439..ad4fc51e 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index 7414c147..b9cbcced 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 91d45c96..0aa48a0f 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 5d1d7b37..61bd5974 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -5,7 +5,7 @@ - + From 005c3e77c6851c783c0da449d11080ea57aa6868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 14 Mar 2024 09:37:49 +0100 Subject: [PATCH 14/18] Try list collections instead --- .../SynchronizedStorage/SynchronizedStorage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs index 6c26ef4b..4d4c3d95 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs @@ -26,7 +26,9 @@ protected override void Setup(FeatureConfigurationContext context) try { - client.GetDatabase(databaseName); + var database = client.GetDatabase(databaseName); + + database.ListCollectionNames(); } catch (ArgumentException ex) { @@ -39,8 +41,6 @@ protected override void Setup(FeatureConfigurationContext context) { if (useTransactions) { - client.ListDatabases(); - var clusterType = client.Cluster.Description.Type; //HINT: cluster configuration check is needed as the built-in checks, executed during "StartTransaction() call, From 767fefaed63993c5c007f6003e3191e8d06827b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 14 Mar 2024 09:44:46 +0100 Subject: [PATCH 15/18] Comment --- .../SynchronizedStorage/SynchronizedStorage.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs index 4d4c3d95..6df03404 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs @@ -28,6 +28,7 @@ protected override void Setup(FeatureConfigurationContext context) { var database = client.GetDatabase(databaseName); + // perform a query to the server to make sure cluster details are loaded so we can check them later database.ListCollectionNames(); } catch (ArgumentException ex) From 87570159bd9998b79ce6debbb3727230c966a998 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Thu, 14 Mar 2024 10:39:50 +0100 Subject: [PATCH 16/18] Try unstable version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cafc7ed9..3c8724ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: path: nugets/ retention-days: 7 - name: Setup MongoDB Server - uses: Particular/setup-mongodb-action@v1.3.1 + uses: Particular/setup-mongodb-action@d58bd7e260eef7f855d490fa7b2550b7e586efc8 with: connection-string-name: NServiceBusStorageMongoDB_ConnectionString mongodb-port: 27018 From 4a65d936cef62715a8704cbd94c9cbca50403f29 Mon Sep 17 00:00:00 2001 From: Daniel Marbach Date: Thu, 14 Mar 2024 10:49:25 +0100 Subject: [PATCH 17/18] Stable version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c8724ea..efcea7e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: path: nugets/ retention-days: 7 - name: Setup MongoDB Server - uses: Particular/setup-mongodb-action@d58bd7e260eef7f855d490fa7b2550b7e586efc8 + uses: Particular/setup-mongodb-action@v1.4.0 with: connection-string-name: NServiceBusStorageMongoDB_ConnectionString mongodb-port: 27018 From 3bdc72d9b59868bf3953522597602e279539605d Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Thu, 14 Mar 2024 11:05:35 -0400 Subject: [PATCH 18/18] Tweaks --- ...Bus.Storage.MongoDB.AcceptanceTests.csproj | 2 +- ...torage.MongoDB.NoTx.AcceptanceTests.csproj | 2 +- ...us.Storage.MongoDB.PersistenceTests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.Tests.csproj | 2 +- ...ransactionalSession.AcceptanceTests.csproj | 2 +- ....MongoDB.TransactionalSession.Tests.csproj | 2 +- .../NServiceBus.Storage.MongoDB.csproj | 4 +- .../SynchronizedStorage.cs | 52 +++++++++---------- 8 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj index 704d3fbf..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj index 704d3fbf..adf9e957 100644 --- a/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj index ad39fe0d..5ac9f96f 100644 --- a/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj index ad4fc51e..924a2439 100644 --- a/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj index b9cbcced..7414c147 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj index 0aa48a0f..91d45c96 100644 --- a/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj +++ b/src/NServiceBus.Storage.MongoDB.TransactionalSession.Tests/NServiceBus.Storage.MongoDB.TransactionalSession.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj index 61bd5974..1c5124d1 100644 --- a/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj +++ b/src/NServiceBus.Storage.MongoDB/NServiceBus.Storage.MongoDB.csproj @@ -1,11 +1,11 @@ - + net8.0 - + diff --git a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs index 6df03404..5a8e26c9 100644 --- a/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs +++ b/src/NServiceBus.Storage.MongoDB/SynchronizedStorage/SynchronizedStorage.cs @@ -28,42 +28,38 @@ protected override void Setup(FeatureConfigurationContext context) { var database = client.GetDatabase(databaseName); - // perform a query to the server to make sure cluster details are loaded so we can check them later + // perform a query to the server to make sure cluster details are loaded database.ListCollectionNames(); - } - catch (ArgumentException ex) - { - throw new Exception($"The persistence database name '{databaseName}' is invalid. Configure a valid database name by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().DatabaseName(databaseName)'.", ex); - } - try - { - using (var session = client.StartSession()) + using var session = client.StartSession(); + + if (useTransactions) { - if (useTransactions) - { - var clusterType = client.Cluster.Description.Type; + var clusterType = client.Cluster.Description.Type; - //HINT: cluster configuration check is needed as the built-in checks, executed during "StartTransaction() call, - // do not detect if the cluster configuration is a supported one. Only the version ranges are validated. - // Without this check, exceptions will be thrown during message processing. - if (clusterType is not ClusterType.ReplicaSet and not ClusterType.Sharded) - { - throw new Exception($"Cluster type in use is {clusterType}, transactions are only supported on replica sets or sharded clusters. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'."); - } + //HINT: cluster configuration check is needed as the built-in checks, executed during "StartTransaction() call, + // do not detect if the cluster configuration is a supported one. Only the version ranges are validated. + // Without this check, exceptions will be thrown during message processing. + if (clusterType is not ClusterType.ReplicaSet and not ClusterType.Sharded) + { + throw new Exception($"The cluster type in use is {clusterType}, but transactions are only supported on replica sets or sharded clusters. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'."); + } - try - { - session.StartTransaction(); - session.AbortTransaction(); - } - catch (NotSupportedException ex) - { - throw new Exception($"Transactions are not supported by the MongoDB server. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'.", ex); - } + try + { + session.StartTransaction(); + session.AbortTransaction(); + } + catch (NotSupportedException ex) + { + throw new Exception($"Transactions are not supported by the MongoDB server. Disable support for transactions by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().UseTransactions(false)'.", ex); } } } + catch (ArgumentException ex) + { + throw new Exception($"The persistence database name '{databaseName}' is invalid. Configure a valid database name by calling 'EndpointConfiguration.UsePersistence<{nameof(MongoPersistence)}>().DatabaseName(databaseName)'.", ex); + } catch (NotSupportedException ex) { throw new Exception("Sessions are not supported by the MongoDB server. The NServiceBus.Storage.MongoDB persistence requires MongoDB server version 3.6 or greater.", ex);