diff --git a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs index 59f443e9..5591bcbf 100644 --- a/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs +++ b/src/net/KEFCore/Infrastructure/Internal/KafkaOptionsExtension.cs @@ -417,6 +417,18 @@ public virtual Properties StreamsOptions(string applicationId) return props; } /// + /// Build for producers + /// + public virtual ProducerConfigBuilder ProducerOptionsBuilder() + { + ProducerConfigBuilder props = _producerConfigBuilder ?? new(); + props.BootstrapServers = BootstrapServers; + props.Acks = ProducerConfigBuilder.AcksTypes.All; + props.Retries = 0; + props.LingerMs = 1; + return props; + } + /// /// Build for producers /// public virtual Properties ProducerOptions() diff --git a/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs b/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs index 3f92192e..fdd0c7b1 100644 --- a/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs +++ b/src/net/KEFCore/Storage/Internal/EntityTypeProducer.cs @@ -230,7 +230,7 @@ public EntityTypeProducer(IEntityType entityType, IKafkaCluster cluster) } else { - _kafkaProducer = new KNetProducer(_cluster.Options.ProducerOptions(), _keySerdes, _valueSerdes); + _kafkaProducer = new KNetProducer(_cluster.Options.ProducerOptionsBuilder(), _keySerdes, _valueSerdes); _streamData = _cluster.Options.UseKNetStreams ? new KNetStreamsRetriever(cluster, entityType) : new KafkaStreamsTableRetriever(cluster, entityType, _keySerdes!, _valueSerdes!); } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetReplicator.json b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetReplicator.json index d1da367d..0dddcd22 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetReplicator.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetReplicator.json @@ -1,6 +1,6 @@ { "UseAvro": true, "DatabaseName": "TestDBBenchmarkAvro", - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetStreams.json index 9d226d8e..484b9a00 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KNetStreams.json @@ -2,6 +2,6 @@ "UseAvro": true, "DatabaseName": "TestDBBenchmarkAvro", "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KafkaStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KafkaStreams.json index 51f7e84f..f5106abe 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Avro.KafkaStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Avro.KafkaStreams.json @@ -3,6 +3,6 @@ "DatabaseName": "TestDBBenchmarkAvro", "UseCompactedReplicator": false, "UseKNetStreams": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.KNetReplicator.json b/test/KEFCore.Benchmark.Test/Benchmark.KNetReplicator.json index ffcda0dd..39e20e8f 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.KNetReplicator.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.KNetReplicator.json @@ -1,5 +1,5 @@ { "DatabaseName": "TestDBBenchmark", - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json index 604058a2..f5968d30 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.KNetStreams.json @@ -1,6 +1,6 @@ { "DatabaseName": "TestDBBenchmark", "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.KafkaStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.KafkaStreams.json index 11708793..0dad30bf 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.KafkaStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.KafkaStreams.json @@ -2,6 +2,6 @@ "DatabaseName": "TestDBBenchmark", "UseCompactedReplicator": false, "UseKNetStreams": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetReplicator.json b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetReplicator.json index 9a008cd0..d657bd9f 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetReplicator.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetReplicator.json @@ -1,6 +1,6 @@ { "UseProtobuf": true, "DatabaseName": "TestDBBenchmarkProtobuf", - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetStreams.json index 73bc95a8..c5840050 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KNetStreams.json @@ -2,6 +2,6 @@ "UseProtobuf": true, "DatabaseName": "TestDBBenchmarkProtobuf", "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KafkaStreams.json b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KafkaStreams.json index 06fa6e67..3f67d2c2 100644 --- a/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KafkaStreams.json +++ b/test/KEFCore.Benchmark.Test/Benchmark.Protobuf.KafkaStreams.json @@ -3,6 +3,6 @@ "DatabaseName": "TestDBBenchmarkProtobuf", "UseCompactedReplicator": false, "UseKNetStreams": false, - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfExecutions": 10 } diff --git a/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json b/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json index 3445e271..8e7ec57b 100644 --- a/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json +++ b/test/KEFCore.Complex.Test/ComplexTest.KNetReplicator.json @@ -1,6 +1,6 @@ { "DatabaseName": "TestDBComplex", - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "NumberOfElements": 10, "NumberOfExtraElements": 1 } diff --git a/test/KEFCore.Extractor.Test/Extractor.Test.Blog.Avro.json b/test/KEFCore.Extractor.Test/Extractor.Test.Blog.Avro.json index 036cbe9e..05c516b9 100644 --- a/test/KEFCore.Extractor.Test/Extractor.Test.Blog.Avro.json +++ b/test/KEFCore.Extractor.Test/Extractor.Test.Blog.Avro.json @@ -1,4 +1,4 @@ { - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "TopicToSubscribe": "TestDBBenchmarkAvro.MASES.EntityFrameworkCore.KNet.Test.Blog" } diff --git a/test/KEFCore.Extractor.Test/Extractor.Test.Blog.json b/test/KEFCore.Extractor.Test/Extractor.Test.Blog.json index 1c64691a..63e94cfa 100644 --- a/test/KEFCore.Extractor.Test/Extractor.Test.Blog.json +++ b/test/KEFCore.Extractor.Test/Extractor.Test.Blog.json @@ -1,4 +1,4 @@ { - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "TopicToSubscribe": "TestDBBenchmark.MASES.EntityFrameworkCore.KNet.Test.Blog" } diff --git a/test/KEFCore.StreamTest/StreamTest.KafkaStreams.json b/test/KEFCore.StreamTest/StreamTest.KafkaStreams.json index 980ff020..e6e63fab 100644 --- a/test/KEFCore.StreamTest/StreamTest.KafkaStreams.json +++ b/test/KEFCore.StreamTest/StreamTest.KafkaStreams.json @@ -1,4 +1,4 @@ { "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsModelBuilder.json b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsModelBuilder.json index 6a9321f3..f2e297ef 100644 --- a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsModelBuilder.json +++ b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsModelBuilder.json @@ -1,5 +1,5 @@ { "UseCompactedReplicator": false, "UseModelBuilder": true, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsNoLoad.json b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsNoLoad.json index 3a8bfc3f..f1f23922 100644 --- a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsNoLoad.json +++ b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsNoLoad.json @@ -2,5 +2,5 @@ "DeleteApplicationData": false, "LoadApplicationData": false, "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsPersisted.json b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsPersisted.json index 0b449505..de41b522 100644 --- a/test/KEFCore.StreamTest/StreamTest.KafkaStreamsPersisted.json +++ b/test/KEFCore.StreamTest/StreamTest.KafkaStreamsPersisted.json @@ -3,5 +3,5 @@ "DeleteApplicationData": false, "LoadApplicationData": false, "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KNetReplicator.json b/test/KEFCore.Test/Test.KNetReplicator.json index 014afc19..cfe268d6 100644 --- a/test/KEFCore.Test/Test.KNetReplicator.json +++ b/test/KEFCore.Test/Test.KNetReplicator.json @@ -1,3 +1,3 @@ { - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json b/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json index 3cfd50d1..71bfffe6 100644 --- a/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json +++ b/test/KEFCore.Test/Test.KNetReplicatorModelBuilder.json @@ -1,4 +1,4 @@ { "UseModelBuilder": true, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json b/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json index ecb8fcc1..adbbcfb4 100644 --- a/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json +++ b/test/KEFCore.Test/Test.KNetReplicatorNoLoad.json @@ -1,5 +1,5 @@ { "DeleteApplicationData": false, "LoadApplicationData": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KNetReplicatorWithEvents.json b/test/KEFCore.Test/Test.KNetReplicatorWithEvents.json index 137131e4..1560a6ef 100644 --- a/test/KEFCore.Test/Test.KNetReplicatorWithEvents.json +++ b/test/KEFCore.Test/Test.KNetReplicatorWithEvents.json @@ -1,5 +1,5 @@ { - "BootstrapServers": "192.168.1.108:9092", + "BootstrapServers": "192.168.0.101:9092", "DatabaseName": "TestDBWithEvents", "NumberOfElements": 10, "WithEvents": true diff --git a/test/KEFCore.Test/Test.KafkaStreams.json b/test/KEFCore.Test/Test.KafkaStreams.json index 980ff020..e6e63fab 100644 --- a/test/KEFCore.Test/Test.KafkaStreams.json +++ b/test/KEFCore.Test/Test.KafkaStreams.json @@ -1,4 +1,4 @@ { "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json b/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json index 6a9321f3..f2e297ef 100644 --- a/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json +++ b/test/KEFCore.Test/Test.KafkaStreamsModelBuilder.json @@ -1,5 +1,5 @@ { "UseCompactedReplicator": false, "UseModelBuilder": true, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json b/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json index 3a8bfc3f..f1f23922 100644 --- a/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json +++ b/test/KEFCore.Test/Test.KafkaStreamsNoLoad.json @@ -2,5 +2,5 @@ "DeleteApplicationData": false, "LoadApplicationData": false, "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/Test.KafkaStreamsPersisted.json b/test/KEFCore.Test/Test.KafkaStreamsPersisted.json index 0b449505..de41b522 100644 --- a/test/KEFCore.Test/Test.KafkaStreamsPersisted.json +++ b/test/KEFCore.Test/Test.KafkaStreamsPersisted.json @@ -3,5 +3,5 @@ "DeleteApplicationData": false, "LoadApplicationData": false, "UseCompactedReplicator": false, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" } diff --git a/test/KEFCore.Test/TestAvro.KNetReplicatorModelBuilder.json b/test/KEFCore.Test/TestAvro.KNetReplicatorModelBuilder.json index e86c5a00..62063665 100644 --- a/test/KEFCore.Test/TestAvro.KNetReplicatorModelBuilder.json +++ b/test/KEFCore.Test/TestAvro.KNetReplicatorModelBuilder.json @@ -1,5 +1,5 @@ { "UseAvro": true, "UseModelBuilder": true, - "BootstrapServers": "192.168.1.108:9092" + "BootstrapServers": "192.168.0.101:9092" }