Skip to content

Commit

Permalink
Update Akka to version 1.4.1-RC1 (#141)
Browse files Browse the repository at this point in the history
* Update Akka to version 1.4.1-RC1

* Hocon config fix test

* Add defaults to Config readers.
  • Loading branch information
Arkatufus authored Mar 3, 2020
1 parent 63039f9 commit 2fe45e3
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Batching
{
Expand All @@ -36,7 +37,7 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Batching
{
Expand Down Expand Up @@ -42,7 +43,7 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Akka.Persistence.TCK.Journal;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Batching
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Batching
{
Expand All @@ -36,7 +37,7 @@ class = ""Akka.Persistence.SqlServer.Journal.BatchingSqlServerJournal, Akka.Pers
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Query
{
Expand All @@ -35,7 +36,7 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}")
.WithFallback(SqlReadJournal.DefaultConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Query
{
Expand All @@ -35,7 +36,7 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}")
.WithFallback(SqlReadJournal.DefaultConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Persistence.TCK.Query;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Query
{
Expand Down Expand Up @@ -41,7 +42,7 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
connection-string = ""{DbUtils.ConnectionString}""
refresh-interval = 1s
}}")
.WithFallback(SqlReadJournal.DefaultConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Akka.Persistence.TCK.Serialization;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Serialization
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Akka.Persistence.TCK.Serialization;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests.Serialization
{
Expand Down
17 changes: 9 additions & 8 deletions src/Akka.Persistence.SqlServer.Tests/SqlServerJournalSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Akka.Persistence.TCK.Journal;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests
{
Expand All @@ -25,21 +26,21 @@ private static Config InitConfig(SqlServerFixture fixture)
{
//need to make sure db is created before the tests start
DbUtils.Initialize(fixture.ConnectionString);
var specString = @"
akka.persistence {
var specString = $@"
akka.persistence {{
publish-plugin-commands = on
journal {
journal {{
plugin = ""akka.persistence.journal.sql-server""
sql-server {
sql-server {{
class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer""
plugin-dispatcher = ""akka.actor.default-dispatcher""
table-name = EventJournal
schema-name = dbo
auto-initialize = on
connection-string = """ + DbUtils.ConnectionString + @"""
}
}
}";
connection-string = ""{DbUtils.ConnectionString}""
}}
}}
}}";

return ConfigurationFactory.ParseString(specString);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Akka.Persistence.SqlServer.Tests/SqlServerSettingsSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Akka.Dispatch;
using FluentAssertions;
using Xunit;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests
{
Expand All @@ -23,7 +24,7 @@ public void Should_SqlServer_journal_has_default_config()
.Be("Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer");
config.GetString("plugin-dispatcher").Should().Be(Dispatchers.DefaultDispatcherId);
config.GetString("connection-string").Should().BeEmpty();
config.GetString("connection-string-name").Should().BeNullOrEmpty();
config.GetString("connection-string-name", null).Should().BeNullOrEmpty();
config.GetTimeSpan("connection-timeout").Should().Be(30.Seconds());
config.GetString("schema-name").Should().Be("dbo");
config.GetString("table-name").Should().Be("EventJournal");
Expand All @@ -44,7 +45,7 @@ public void Should_SqlServer_snapshot_has_default_config()
.Be("Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer");
config.GetString("plugin-dispatcher").Should().Be(Dispatchers.DefaultDispatcherId);
config.GetString("connection-string").Should().BeEmpty();
config.GetString("connection-string-name").Should().BeNullOrEmpty();
config.GetString("connection-string-name", null).Should().BeNullOrEmpty();
config.GetTimeSpan("connection-timeout").Should().Be(30.Seconds());
config.GetString("schema-name").Should().Be("dbo");
config.GetString("table-name").Should().Be("SnapshotStore");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Akka.Persistence.TCK.Snapshot;
using Xunit;
using Xunit.Abstractions;
using Hocon;

namespace Akka.Persistence.SqlServer.Tests
{
Expand Down
1 change: 1 addition & 0 deletions src/Akka.Persistence.SqlServer/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Akka.Actor;
using Akka.Configuration;
using Akka.Persistence.Sql.Common;
using Hocon;

namespace Akka.Persistence.SqlServer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Data.SqlClient;
using Akka.Configuration;
using Akka.Persistence.Sql.Common.Journal;
using Hocon;

namespace Akka.Persistence.SqlServer.Journal
{
Expand All @@ -30,8 +31,8 @@ public sealed class BatchingSqlServerJournalSetup : BatchingSqlJournalSetup
"Ordering",
"SerializerId",
config.GetTimeSpan("connection-timeout", TimeSpan.FromSeconds(30)),
config.GetString("serializer"),
config.GetBoolean("sequential-access")))
config.GetString("serializer", null),
config.GetBoolean("sequential-access", false)))
{
}

Expand Down
13 changes: 7 additions & 6 deletions src/Akka.Persistence.SqlServer/Journal/SqlServerJournal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data.SqlClient;
using Akka.Configuration;
using Akka.Persistence.Sql.Common.Journal;
using Hocon;

namespace Akka.Persistence.SqlServer.Journal
{
Expand All @@ -19,9 +20,9 @@ public SqlServerJournal(Config journalConfig) : base(journalConfig)
{
var config = journalConfig.WithFallback(Extension.DefaultJournalConfig);
QueryExecutor = new SqlServerQueryExecutor(new QueryConfiguration(
config.GetString("schema-name"),
config.GetString("table-name"),
config.GetString("metadata-table-name"),
config.GetString("schema-name", null),
config.GetString("table-name", null),
config.GetString("metadata-table-name", null),
"PersistenceId",
"SequenceNr",
"Payload",
Expand All @@ -31,9 +32,9 @@ public SqlServerJournal(Config journalConfig) : base(journalConfig)
"Tags",
"Ordering",
"SerializerId",
config.GetTimeSpan("connection-timeout"),
config.GetString("serializer"),
config.GetBoolean("sequential-access")),
config.GetTimeSpan("connection-timeout", null),
config.GetString("serializer", null),
config.GetBoolean("sequential-access", false)),
Context.System.Serialization,
GetTimestampProvider(config.GetString("timestamp-provider")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data.SqlClient;
using Akka.Configuration;
using Akka.Persistence.Sql.Common.Snapshot;
using Hocon;

namespace Akka.Persistence.SqlServer.Snapshot
{
Expand All @@ -20,17 +21,17 @@ public SqlServerSnapshotStore(Config snapshotConfig) : base(snapshotConfig)
var config = snapshotConfig.WithFallback(Extension.DefaultSnapshotConfig);
QueryExecutor = new SqlServerQueryExecutor(new QueryConfiguration(

schemaName: config.GetString("schema-name"),
snapshotTableName: config.GetString("table-name"),
schemaName: config.GetString("schema-name", null),
snapshotTableName: config.GetString("table-name", null),
persistenceIdColumnName: "PersistenceId",
sequenceNrColumnName: "SequenceNr",
payloadColumnName: "Snapshot",
manifestColumnName: "Manifest",
timestampColumnName: "Timestamp",
serializerIdColumnName: "SerializerId",
timeout: config.GetTimeSpan("connection-timeout"),
defaultSerializer: config.GetString("serializer"),
useSequentialAccess: config.GetBoolean("sequential-access")),
timeout: config.GetTimeSpan("connection-timeout", null),
defaultSerializer: config.GetString("serializer", null),
useSequentialAccess: config.GetBoolean("sequential-access", false)),
Context.System.Serialization);
}

Expand Down
2 changes: 1 addition & 1 deletion src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Upgrades to latest SqlClient.
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.1</XunitVersion>
<AkkaVersion>1.3.17</AkkaVersion>
<AkkaVersion>1.4.1-rc1</AkkaVersion>
<TestSdkVersion>16.5.0</TestSdkVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetFrameworkTestVersion>net461</NetFrameworkTestVersion>
Expand Down

0 comments on commit 2fe45e3

Please sign in to comment.