From a94c062f4bfc67f671c7a611a1d5bc5948fe91bc Mon Sep 17 00:00:00 2001
From: MASES Public Developers Team
<94312179+masesdevelopers@users.noreply.github.com>
Date: Sat, 14 Oct 2023 17:20:39 +0200
Subject: [PATCH] KNetCompactedReplicator becomes the default engine (#96)
---
src/net/Common/Common.props | 2 +-
.../KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs | 4 ++--
src/net/KEFCore/Infrastructure/KafkaDbContext.cs | 2 +-
test/Common/ProgramConfig.cs | 2 +-
.../Benchmark.Avro.Test.InMemory.json | 3 ++-
.../Benchmark.Avro.Test.KNetReplicator.json | 2 +-
.../Benchmark.Avro.Test.KafkaStreams.json | 2 ++
test/KEFCore.Benchmark.Test/BenchmarkTest.InMemory.json | 3 ++-
test/KEFCore.Benchmark.Test/BenchmarkTest.KNetReplicator.json | 2 +-
test/KEFCore.Benchmark.Test/BenchmarkTest.KafkaStreams.json | 2 ++
test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json | 1 -
test/KEFCore.Test/Test.KNetReplicator.json | 1 -
test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json | 1 -
test/KEFCore.Test/Test.KNetReplicatorNoLoad.json | 1 -
test/KEFCore.Test/Test.KafkaStreams.json | 1 +
test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json | 1 +
test/KEFCore.Test/Test.KafkaStreamsNoLoad.json | 1 +
test/KEFCore.Test/Test.KafkaStreamsPersisted.json | 1 +
18 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/net/Common/Common.props b/src/net/Common/Common.props
index b7502ec6..305ad93e 100644
--- a/src/net/Common/Common.props
+++ b/src/net/Common/Common.props
@@ -4,7 +4,7 @@
MASES s.r.l.
MASES s.r.l.
MASES s.r.l.
- 0.9.1.0
+ 0.9.2.0
net6.0
latest
true
diff --git a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs
index e0eda6f2..15a85650 100644
--- a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs
+++ b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs
@@ -46,7 +46,7 @@ public class KafkaOptionsExtension : IDbContextOptionsExtension
private string? _applicationId;
private string? _bootstrapServers;
//private bool _producerByEntity = false;
- private bool _useCompactedReplicator = false;
+ private bool _useCompactedReplicator = true;
private bool _usePersistentStorage = false;
private int _defaultNumPartitions = 1;
private int? _defaultConsumerInstances = null;
@@ -203,7 +203,7 @@ public virtual KafkaOptionsExtension WithBootstrapServers(string bootstrapServer
// return clone;
//}
- public virtual KafkaOptionsExtension WithCompactedReplicator(bool useCompactedReplicator = false)
+ public virtual KafkaOptionsExtension WithCompactedReplicator(bool useCompactedReplicator = true)
{
var clone = Clone();
diff --git a/src/net/KEFCore/Infrastructure/KafkaDbContext.cs b/src/net/KEFCore/Infrastructure/KafkaDbContext.cs
index 2f32c74b..19515973 100644
--- a/src/net/KEFCore/Infrastructure/KafkaDbContext.cs
+++ b/src/net/KEFCore/Infrastructure/KafkaDbContext.cs
@@ -202,7 +202,7 @@ public KafkaDbContext(DbContextOptions options) : base(options)
///
/// Use instead of Apache Kafka Streams
///
- public virtual bool UseCompactedReplicator { get; set; } = false;
+ public virtual bool UseCompactedReplicator { get; set; } = true;
///
/// The optional used when is
///
diff --git a/test/Common/ProgramConfig.cs b/test/Common/ProgramConfig.cs
index 9a58a26c..fada0df8 100644
--- a/test/Common/ProgramConfig.cs
+++ b/test/Common/ProgramConfig.cs
@@ -30,7 +30,7 @@ public class ProgramConfig
public bool EnableKEFCoreTracing { get; set; } = false;
public bool UseInMemoryProvider { get; set; } = false;
public bool UseModelBuilder { get; set; } = false;
- public bool UseCompactedReplicator { get; set; } = false;
+ public bool UseCompactedReplicator { get; set; } = true;
public bool UsePersistentStorage { get; set; } = false;
public string DatabaseName { get; set; } = "TestDB";
public string DatabaseNameWithModel { get; set; } = "TestDBWithModel";
diff --git a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.InMemory.json b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.InMemory.json
index b09c7f10..1233cce2 100644
--- a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.InMemory.json
+++ b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.InMemory.json
@@ -1,4 +1,5 @@
{
+ "DatabaseName": "TestDBBenchmarkAvro",
"UseInMemoryProvider": true,
- "NumberOfExecutions": 10
+ "NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KNetReplicator.json b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KNetReplicator.json
index 4ae48342..e481c44e 100644
--- a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KNetReplicator.json
+++ b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KNetReplicator.json
@@ -1,5 +1,5 @@
{
- "UseCompactedReplicator": true,
+ "DatabaseName": "TestDBBenchmarkAvro",
"BootstrapServers": "192.168.1.103:9092",
"NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KafkaStreams.json b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KafkaStreams.json
index 65cc5311..cc9ff027 100644
--- a/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KafkaStreams.json
+++ b/test/KEFCore.Benchmark.Avro.Test/Benchmark.Avro.Test.KafkaStreams.json
@@ -1,4 +1,6 @@
{
+ "DatabaseName": "TestDBBenchmarkAvro",
+ "UseCompactedReplicator": false,
"BootstrapServers": "192.168.1.103:9092",
"NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Benchmark.Test/BenchmarkTest.InMemory.json b/test/KEFCore.Benchmark.Test/BenchmarkTest.InMemory.json
index b09c7f10..0d6b59b6 100644
--- a/test/KEFCore.Benchmark.Test/BenchmarkTest.InMemory.json
+++ b/test/KEFCore.Benchmark.Test/BenchmarkTest.InMemory.json
@@ -1,4 +1,5 @@
{
+ "DatabaseName": "TestDBBenchmark",
"UseInMemoryProvider": true,
- "NumberOfExecutions": 10
+ "NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Benchmark.Test/BenchmarkTest.KNetReplicator.json b/test/KEFCore.Benchmark.Test/BenchmarkTest.KNetReplicator.json
index 4ae48342..a3d394ce 100644
--- a/test/KEFCore.Benchmark.Test/BenchmarkTest.KNetReplicator.json
+++ b/test/KEFCore.Benchmark.Test/BenchmarkTest.KNetReplicator.json
@@ -1,5 +1,5 @@
{
- "UseCompactedReplicator": true,
+ "DatabaseName": "TestDBBenchmark",
"BootstrapServers": "192.168.1.103:9092",
"NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Benchmark.Test/BenchmarkTest.KafkaStreams.json b/test/KEFCore.Benchmark.Test/BenchmarkTest.KafkaStreams.json
index 65cc5311..0ce92c41 100644
--- a/test/KEFCore.Benchmark.Test/BenchmarkTest.KafkaStreams.json
+++ b/test/KEFCore.Benchmark.Test/BenchmarkTest.KafkaStreams.json
@@ -1,4 +1,6 @@
{
+ "DatabaseName": "TestDBBenchmark",
+ "UseCompactedReplicator": false,
"BootstrapServers": "192.168.1.103:9092",
"NumberOfExecutions": 10
}
diff --git a/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json b/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json
index eb441e51..2eea8bca 100644
--- a/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json
+++ b/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json
@@ -1,6 +1,5 @@
{
"DatabaseName": "TestDBComplex",
- "UseCompactedReplicator": true,
"BootstrapServers": "192.168.1.103:9092",
"NumberOfElements": 10,
"NumberOfExtraElements": 1
diff --git a/test/KEFCore.Test/Test.KNetReplicator.json b/test/KEFCore.Test/Test.KNetReplicator.json
index 064ce140..243bea6a 100644
--- a/test/KEFCore.Test/Test.KNetReplicator.json
+++ b/test/KEFCore.Test/Test.KNetReplicator.json
@@ -1,4 +1,3 @@
{
- "UseCompactedReplicator": true,
"BootstrapServers": "192.168.1.103:9092"
}
diff --git a/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json b/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json
index 8965f7e2..562f8dc7 100644
--- a/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json
+++ b/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json
@@ -1,5 +1,4 @@
{
- "UseCompactedReplicator": true,
"UseModelBuilder": true,
"BootstrapServers": "192.168.1.103:9092"
}
diff --git a/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json b/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json
index c8c48603..99c3dced 100644
--- a/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json
+++ b/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json
@@ -1,5 +1,4 @@
{
- "UseCompactedReplicator": true,
"DeleteApplicationData": false,
"LoadApplicationData": false,
"BootstrapServers": "192.168.1.103:9092"
diff --git a/test/KEFCore.Test/Test.KafkaStreams.json b/test/KEFCore.Test/Test.KafkaStreams.json
index 243bea6a..602575ba 100644
--- a/test/KEFCore.Test/Test.KafkaStreams.json
+++ b/test/KEFCore.Test/Test.KafkaStreams.json
@@ -1,3 +1,4 @@
{
+ "UseCompactedReplicator": false,
"BootstrapServers": "192.168.1.103:9092"
}
diff --git a/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json b/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json
index 562f8dc7..3020d098 100644
--- a/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json
+++ b/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json
@@ -1,4 +1,5 @@
{
+ "UseCompactedReplicator": false,
"UseModelBuilder": true,
"BootstrapServers": "192.168.1.103:9092"
}
diff --git a/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json b/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json
index 99c3dced..4b3b764d 100644
--- a/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json
+++ b/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json
@@ -1,5 +1,6 @@
{
"DeleteApplicationData": false,
"LoadApplicationData": false,
+ "UseCompactedReplicator": false,
"BootstrapServers": "192.168.1.103:9092"
}
diff --git a/test/KEFCore.Test/Test.KafkaStreamsPersisted.json b/test/KEFCore.Test/Test.KafkaStreamsPersisted.json
index 8ddb4d9d..ca645ace 100644
--- a/test/KEFCore.Test/Test.KafkaStreamsPersisted.json
+++ b/test/KEFCore.Test/Test.KafkaStreamsPersisted.json
@@ -2,5 +2,6 @@
"UsePersistentStorage": true,
"DeleteApplicationData": false,
"LoadApplicationData": false,
+ "UseCompactedReplicator": false,
"BootstrapServers": "192.168.1.103:9092"
}