Skip to content
Open
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
<Product>Vertex</Product>
<Authors>uless</Authors>
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<PackageOutputPath>$(SolutionDir)/package/$(Configuration)</PackageOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Update="Confluent.Kafka" Version="2.6.0" />
<PackageReference Update="RabbitMQ.Client" Version="6.8.1" />
<PackageReference Update="System.Reactive" Version="6.0.1" />
<PackageReference Update="linq2db" Version="4.1.1" />
<PackageReference Update="linq2db" Version="5.4.1" />
<PackageReference Update="IdGen" Version="3.0.7" />

<PackageReference Update="Lindhart.Analyser.MissingAwaitWarning" Version="2.0.0" PrivateAssets="All" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
---
* 框架采用Event sourcing来解决分布式事务问题,除了提供超高吞吐的分布式事务能力之外,还提供状态变化的详细事件日志,易于追踪溯源,在某些领域有着天然的优势。

* 基于. Net 6.0和Orleans开发,支持从单个本地服务器扩展到多服务器集群,提供高可用能力。
* 基于. Net 8.0和Orleans开发,支持从单个本地服务器扩展到多服务器集群,提供高可用能力。
---

### 项目起源
Expand Down
2 changes: 2 additions & 0 deletions Vertex.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageReference Update="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Update="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Update="MySqlConnector" Version="2.2.0" />
<PackageReference Update="Npgsql" Version="7.0.0" />
<PackageReference Update="Npgsql" Version="8.0.4" />
<PackageReference Update="Microsoft.Data.SqlClient" Version="5.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Storage/Vertex.Storage.Linq2db/Db/EventDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Vertex.Storage.Linq2db/Db/SnapshotDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,4 +21,4 @@ public SnapshotDb(string name)

public ITable<SnapshotEntity<TPrimaryKey>> Table<TPrimaryKey>() => this.GetTable<SnapshotEntity<TPrimaryKey>>();
}
}
}
2 changes: 1 addition & 1 deletion src/Storage/Vertex.Storage.Linq2db/Db/SubSnapshotDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Stream/Vertex.Stream.InMemory/Consumer/ConsumerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Stream/Vertex.Stream.Kafka/Consumer/ConsumerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Stream/Vertex.Stream.RabbitMQ/Consumer/ConsumerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Vertex.Protocol/EventConverter.cs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Text;
using Vertex.Utils;

Expand Down
6 changes: 6 additions & 0 deletions src/Vertex.Runtime/Exceptions/EventVersionException.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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; }
}
}
6 changes: 6 additions & 0 deletions src/Vertex.Runtime/Exceptions/SnapshotException.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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; }
}
}
2 changes: 2 additions & 0 deletions src/Vertex.Runtime/Exceptions/VertexEventHandlerException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using Orleans;

namespace Vertex.Runtime.Exceptions
{
[GenerateSerializer]
public class VertexEventHandlerException : Exception
{
public VertexEventHandlerException(Type eventType)
Expand Down
2 changes: 1 addition & 1 deletion src/Vertex.Runtime/Serialization/EventTypeContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Linq;
using Microsoft.Extensions.Logging;
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -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+"
Expand Down