diff --git a/Directory.Build.props b/Directory.Build.props index cc7fa93..268d8f9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,12 +22,17 @@ Vertex uless 1701;1702;1705;1591 + + + $(SolutionDir)/package/$(Configuration) + true true true true + true portable diff --git a/Packages.props b/Packages.props index 769d378..5f96034 100644 --- a/Packages.props +++ b/Packages.props @@ -32,7 +32,7 @@ - + diff --git a/README.md b/README.md index c931c75..7886ad6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ --- * 框架采用Event sourcing来解决分布式事务问题,除了提供超高吞吐的分布式事务能力之外,还提供状态变化的详细事件日志,易于追踪溯源,在某些领域有着天然的优势。 -* 基于. Net 6.0和Orleans开发,支持从单个本地服务器扩展到多服务器集群,提供高可用能力。 +* 基于. Net 8.0和Orleans开发,支持从单个本地服务器扩展到多服务器集群,提供高可用能力。 --- ### 项目起源 diff --git a/Vertex.sln b/Vertex.sln index 134fe0f..1beb2fa 100644 --- a/Vertex.sln +++ b/Vertex.sln @@ -59,6 +59,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig Packages.props = Packages.props + Directory.Build.props = Directory.Build.props + README.md = README.md EndProjectSection EndProject Global diff --git a/examples/Packages.props b/examples/Packages.props index 5326166..b2c6736 100644 --- a/examples/Packages.props +++ b/examples/Packages.props @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/src/Storage/Vertex.Storage.Linq2db/Db/EventDb.cs b/src/Storage/Vertex.Storage.Linq2db/Db/EventDb.cs index dabdf1a..4835495 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Db/EventDb.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Db/EventDb.cs @@ -9,7 +9,7 @@ public class EventDb : DataConnection public EventDb(string name) : base(name) { - this.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => + LinqToDB.Mapping.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => { entityDescriptor.TableName = entityDescriptor.TableName.ToLower(); foreach (var entityDescriptorColumn in entityDescriptor.Columns) diff --git a/src/Storage/Vertex.Storage.Linq2db/Db/SnapshotDb.cs b/src/Storage/Vertex.Storage.Linq2db/Db/SnapshotDb.cs index 6c0881a..42486a0 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Db/SnapshotDb.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Db/SnapshotDb.cs @@ -9,7 +9,7 @@ public class SnapshotDb : DataConnection public SnapshotDb(string name) : base(name) { - this.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => + LinqToDB.Mapping.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => { entityDescriptor.TableName = entityDescriptor.TableName.ToLower(); foreach (var entityDescriptorColumn in entityDescriptor.Columns) @@ -21,4 +21,4 @@ public SnapshotDb(string name) public ITable> Table() => this.GetTable>(); } -} +} \ No newline at end of file diff --git a/src/Storage/Vertex.Storage.Linq2db/Db/SubSnapshotDb.cs b/src/Storage/Vertex.Storage.Linq2db/Db/SubSnapshotDb.cs index e4bbd6f..fb03c99 100644 --- a/src/Storage/Vertex.Storage.Linq2db/Db/SubSnapshotDb.cs +++ b/src/Storage/Vertex.Storage.Linq2db/Db/SubSnapshotDb.cs @@ -9,7 +9,7 @@ public class SubSnapshotDb : DataConnection public SubSnapshotDb(string name) : base(name) { - this.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => + LinqToDB.Mapping.MappingSchema.EntityDescriptorCreatedCallback = (schema, entityDescriptor) => { entityDescriptor.TableName = entityDescriptor.TableName.ToLower(); foreach (var entityDescriptorColumn in entityDescriptor.Columns) diff --git a/src/Stream/Vertex.Stream.InMemory/Consumer/ConsumerManager.cs b/src/Stream/Vertex.Stream.InMemory/Consumer/ConsumerManager.cs index 0897b7e..7ff0492 100644 --- a/src/Stream/Vertex.Stream.InMemory/Consumer/ConsumerManager.cs +++ b/src/Stream/Vertex.Stream.InMemory/Consumer/ConsumerManager.cs @@ -86,9 +86,9 @@ public Task StartAsync(CancellationToken cancellationToken) this.logger.LogInformation("EventBus Background Service is starting."); } - this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(), null, 1000, MonitTime); - this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(), null, HoldTime, HoldTime); - this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(); }, null, CheckTime, CheckTime); + this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(cancellationToken), null, 1000, MonitTime); + this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(cancellationToken), null, HoldTime, HoldTime); + this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(cancellationToken); }, null, CheckTime, CheckTime); return Task.CompletedTask; } diff --git a/src/Stream/Vertex.Stream.Kafka/Consumer/ConsumerManager.cs b/src/Stream/Vertex.Stream.Kafka/Consumer/ConsumerManager.cs index 8b26222..a2f7893 100644 --- a/src/Stream/Vertex.Stream.Kafka/Consumer/ConsumerManager.cs +++ b/src/Stream/Vertex.Stream.Kafka/Consumer/ConsumerManager.cs @@ -87,9 +87,9 @@ public Task StartAsync(CancellationToken cancellationToken) this.logger.LogInformation("EventBus Background Service is starting."); } - this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(), null, 1000, MonitTime); - this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(), null, HoldTime, HoldTime); - this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(); }, null, CheckTime, CheckTime); + this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(cancellationToken), null, 1000, MonitTime); + this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(cancellationToken), null, HoldTime, HoldTime); + this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(cancellationToken); }, null, CheckTime, CheckTime); return Task.CompletedTask; } diff --git a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerManager.cs b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerManager.cs index 4ada5f0..da2aeb4 100644 --- a/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerManager.cs +++ b/src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerManager.cs @@ -83,9 +83,9 @@ public Task StartAsync(CancellationToken cancellationToken) this.logger.LogInformation("EventBus Background Service is starting."); } - this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(), null, 1000, MonitTime); - this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(), null, HoldTime, HoldTime); - this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(); }, null, CheckTime, CheckTime); + this.distributedMonitorTime = new Timer(state => this.DistributedStart().Wait(cancellationToken), null, 1000, MonitTime); + this.distributedHoldTimer = new Timer(state => this.DistributedHold().Wait(cancellationToken), null, HoldTime, HoldTime); + this.heathCheckTimer = new Timer(state => { this.HeathCheck().Wait(cancellationToken); }, null, CheckTime, CheckTime); return Task.CompletedTask; } diff --git a/src/Vertex.Protocol/EventConverter.cs.cs b/src/Vertex.Protocol/EventConverter.cs.cs index dbaf0e8..f23296c 100644 --- a/src/Vertex.Protocol/EventConverter.cs.cs +++ b/src/Vertex.Protocol/EventConverter.cs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using Vertex.Utils; diff --git a/src/Vertex.Runtime/Exceptions/EventVersionException.cs b/src/Vertex.Runtime/Exceptions/EventVersionException.cs index 6ff4245..06d9934 100644 --- a/src/Vertex.Runtime/Exceptions/EventVersionException.cs +++ b/src/Vertex.Runtime/Exceptions/EventVersionException.cs @@ -1,7 +1,9 @@ using System; +using Orleans; namespace Vertex.Runtime.Exceptions { + [GenerateSerializer] public class EventVersionException : Exception { public EventVersionException(string id, Type type, long eventVersion, long snapshotVersion) @@ -13,12 +15,16 @@ public EventVersionException(string id, Type type, long eventVersion, long snaps this.EventVersion = eventVersion; } + [Id(0)] public string GrainTypeName { get; set; } + [Id(1)] public string ActorId { get; set; } + [Id(2)] public long SnapshotVersion { get; set; } + [Id(3)] public long EventVersion { get; set; } } } diff --git a/src/Vertex.Runtime/Exceptions/SnapshotException.cs b/src/Vertex.Runtime/Exceptions/SnapshotException.cs index 8619ac8..b7836e5 100644 --- a/src/Vertex.Runtime/Exceptions/SnapshotException.cs +++ b/src/Vertex.Runtime/Exceptions/SnapshotException.cs @@ -1,7 +1,9 @@ using System; +using Orleans; namespace Vertex.Runtime.Exceptions { + [GenerateSerializer] public class SnapshotException : Exception { public SnapshotException(string id, Type grainType, long doingVersion, long snapshotVersion) @@ -13,12 +15,16 @@ public SnapshotException(string id, Type grainType, long doingVersion, long snap this.DoingVersion = doingVersion; } + [Id(0)] public string GrainTypeName { get; set; } + [Id(1)] public string ActorId { get; set; } + [Id(2)] public long SnapshotVersion { get; set; } + [Id(3)] public long DoingVersion { get; set; } } } diff --git a/src/Vertex.Runtime/Exceptions/VertexEventHandlerException.cs b/src/Vertex.Runtime/Exceptions/VertexEventHandlerException.cs index a7d0bd4..c88e4a1 100644 --- a/src/Vertex.Runtime/Exceptions/VertexEventHandlerException.cs +++ b/src/Vertex.Runtime/Exceptions/VertexEventHandlerException.cs @@ -1,7 +1,9 @@ using System; +using Orleans; namespace Vertex.Runtime.Exceptions { + [GenerateSerializer] public class VertexEventHandlerException : Exception { public VertexEventHandlerException(Type eventType) diff --git a/src/Vertex.Runtime/Serialization/EventTypeContainer.cs b/src/Vertex.Runtime/Serialization/EventTypeContainer.cs index 8ca64cf..30da300 100644 --- a/src/Vertex.Runtime/Serialization/EventTypeContainer.cs +++ b/src/Vertex.Runtime/Serialization/EventTypeContainer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/version.json b/version.json index c38732f..bdf9c6f 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.5", + "version": "8.2.0", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/tags/v\\d+\\.\\d+\\.\\d+"