-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CONFIGURATION compiler directive is missing from Akka.Persistence.Sql…
….Common netstandard2.0 build target (#4345) * Add System.Configuration.ConfigurationManager support for NET standard 2.0 build. * Possible null exception, need to check that the ConnectionStrings collection returns an object instance before accessing the ConnectionString property. * Simple rudimentary test for App.config access. This could not be tested from unit testing because Microsoft broke ConfigurationManager. Again.
- Loading branch information
Showing
6 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
|
||
<configSections> | ||
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" /> | ||
</configSections> | ||
|
||
<connectionStrings> | ||
<clear/> | ||
<add name="myConnectionString" connectionString="myDB://MyConnectionString"/> | ||
</connectionStrings> | ||
|
||
<akka> | ||
<hocon> | ||
<![CDATA[ | ||
akka.persistence.journal.sqlite = { | ||
connection-string-name = myConnectionString | ||
replay-filter = { | ||
mode = off | ||
} | ||
} | ||
]]> | ||
</hocon> | ||
</akka> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="App.config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="App.config" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\contrib\persistence\Akka.Persistence.Sqlite\Akka.Persistence.Sqlite.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using Akka.Actor; | ||
using Akka.Configuration; | ||
using Akka.Persistence.Sql.Common; | ||
using Akka.Persistence.Sqlite.Journal; | ||
using Akka.Persistence.Sqlite; | ||
using Akka.Util.Internal; | ||
|
||
namespace AppConfig | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var system = ActorSystem.Create(Guid.NewGuid().ToString(), ConfigurationFactory.Load()); | ||
SqlitePersistence.Get(system); | ||
var config = system.Settings.Config.GetConfig("akka.persistence.journal.sqlite"); | ||
var setup = new BatchingSqliteJournalSetup(config); | ||
|
||
Console.WriteLine("If running properly, BatchingSqliteJournalSetup.ConnectionString should return 'myDB://MyConnectionString'."); | ||
Console.WriteLine($"Connection string is: {setup.ConnectionString}"); | ||
} | ||
} | ||
} |