diff --git a/src/Akka.Persistence.Azure.Tests/AzurePersistenceConfigSpec.cs b/src/Akka.Persistence.Azure.Tests/AzurePersistenceConfigSpec.cs index cbbf699..b6685c6 100644 --- a/src/Akka.Persistence.Azure.Tests/AzurePersistenceConfigSpec.cs +++ b/src/Akka.Persistence.Azure.Tests/AzurePersistenceConfigSpec.cs @@ -42,6 +42,19 @@ public void ShouldParseDefaultSnapshotConfig() blobSettings.RequestTimeout.Should().Be(TimeSpan.FromSeconds(3)); blobSettings.VerboseLogging.Should().BeFalse(); } + + [Fact] + public void ShouldProvideDefaultContainerNameValue() + { + var blobSettings = + AzureBlobSnapshotStoreSettings.Create( + ConfigurationFactory.ParseString(@"akka.persistence.snapshot-store.azure-blob-store{ + connection-string = foo + }").WithFallback(AzurePersistence.DefaultConfig) + .GetConfig("akka.persistence.snapshot-store.azure-blob-store")); + + blobSettings.ContainerName.Should().Be("akka-persistence-default-container"); + } [Fact] public void ShouldParseTableConfig() @@ -61,6 +74,18 @@ public void ShouldParseTableConfig() tableSettings.VerboseLogging.Should().BeFalse(); } + [Fact] + public void ShouldProvideDefaultTableNameValue() + { + var tableSettings = + AzureTableStorageJournalSettings.Create( + ConfigurationFactory.ParseString(@"akka.persistence.journal.azure-table{ + connection-string = foo + }").WithFallback(AzurePersistence.DefaultConfig) + .GetConfig("akka.persistence.journal.azure-table")); + tableSettings.TableName.Should().Be("AkkaPersistenceDefaultTable"); + } + [Fact] public void ShouldParseQueryConfig() { diff --git a/src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSettings.cs b/src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSettings.cs index 67b47be..1d7f1bc 100644 --- a/src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSettings.cs +++ b/src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSettings.cs @@ -16,7 +16,6 @@ namespace Akka.Persistence.Azure.Journal /// public sealed class AzureTableStorageJournalSettings { - private static readonly string[] ReservedTableNames = {"tables"}; public AzureTableStorageJournalSettings( @@ -79,7 +78,6 @@ public static AzureTableStorageJournalSettings Create(Config config) var connectTimeout = config.GetTimeSpan("connect-timeout", TimeSpan.FromSeconds(3)); var requestTimeout = config.GetTimeSpan("request-timeout", TimeSpan.FromSeconds(3)); var verbose = config.GetBoolean("verbose-logging", false); - return new AzureTableStorageJournalSettings( connectionString, tableName, diff --git a/src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStoreSettings.cs b/src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStoreSettings.cs index 8cf2512..b885911 100644 --- a/src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStoreSettings.cs +++ b/src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStoreSettings.cs @@ -61,11 +61,15 @@ public AzureBlobSnapshotStoreSettings(string connectionString, string containerN public static AzureBlobSnapshotStoreSettings Create(Config config) { var connectionString = config.GetString("connection-string"); - var containerName = config.GetString("container-name"); var connectTimeout = config.GetTimeSpan("connect-timeout", TimeSpan.FromSeconds(3)); var requestTimeout = config.GetTimeSpan("request-timeout", TimeSpan.FromSeconds(3)); var verbose = config.GetBoolean("verbose-logging", false); - return new AzureBlobSnapshotStoreSettings(connectionString, containerName, connectTimeout, requestTimeout, + var containerName = config.GetString("container-name"); + return new AzureBlobSnapshotStoreSettings( + connectionString, + containerName, + connectTimeout, + requestTimeout, verbose); } } diff --git a/src/Akka.Persistence.Azure/reference.conf b/src/Akka.Persistence.Azure/reference.conf index 8ed299f..39fb63f 100644 --- a/src/Akka.Persistence.Azure/reference.conf +++ b/src/Akka.Persistence.Azure/reference.conf @@ -12,7 +12,7 @@ akka.persistence { connection-string = "" # the name of the Windows Azure Table used to persist journal events - table-name = "" + table-name = "AkkaPersistenceDefaultTable" # Initial timeout to use when connecting to Azure Storage for the first time. connect-timeout = 3s @@ -63,7 +63,7 @@ akka.persistence { connection-string = "" # the name of the Windows Azure Blob Store container used to persist snapshots - container-name = "" + container-name = "akka-persistence-default-container" # Initial timeout to use when connecting to Azure Storage for the first time. connect-timeout = 3s