Skip to content

Akka.Persistence.Azure v1.5.13

Compare
Choose a tag to compare
@Aaronontheweb Aaronontheweb released this 06 Oct 20:24
0bf73aa

1.5.13 October 6 2023

1.5.1 March 16 2023

Multi Journal Support

You can now add more than one Akka.Persistence.Azure settings and use them singularly for different Akka plugins.

In the example below, we set up two separate journal options with two distinct identifier, one is being used as default persistence plugin, and the other are being used as the journal for cluster sharding.

var persistenceJournal = new AzureTableStorageJournalOptions(true)
{
    Identifier = "azure-journal",
    ConnectionString = connectionString
};
var shardJournal = new AzureTableStorageJournalOptions(false)
{
    Identifier = "azure-shard-journal",
    ConnectionString = shardConnectionString
};
builder
    .WithClustering()
    .WithAzureTableJournal(persistenceJournal)
    .WithAzureTableJournal(shardJournal)
    .WithAzureBlobsSnapshotStore(new AzureBlobSnapshotOptions
    {
        ConnectionString = connectionString
    })
    .WithShardRegion<ShardRegionKey>(
        "region-1",
        Customer.Props,
        new MessageExtractor(10),
        new ShardOptions
        {
            JournalOptions = shardJournal,
            StateStoreMode = StateStoreMode.Persistence
        });

1.5.0 March 02 2023

0.9.2 September 27 2022

0.9.1 August 29 2022

New Setup classes are added to allow programmatic setup of the journal table and snapshot-store blog storage; these setup classes supports DefaultAzureCredential. Note that to use DefaultAzureCredential from the Azure.Identity package, you need to provide both service URI and credential.

var host = new HostBuilder()
    .ConfigureServices(collection =>
    {
        collection.AddAkka("MyActorSys", builder =>
        {
            var credentials = new DefaultAzureCredential();
            
            // Programatically setup the journal table
            builder.WithAzureTableJournal(setup => {
                setup.TableName = "myazuretable";
                setup.ServiceUri = new Uri("https://{account_name}.table.core.windows.net");
                setup.DefaultAzureCredential = credentials;
                // Optional TableClientOptions
                setup.TableClientOptions = new TableClientOptions(); 
            });
            
            // Programatically setup the snapshot-store blob container
            builder.WithAzureBlobsSnapshotStore(setup => {
                setup.ContainerName = "myAzureBlobContainer";
                setup.ServiceUri = new Uri("https://{account_name}.blob.core.windows.net");
                setup.DefaultAzureCredential = credentials;
                // Optional BlobClientOptions
                setup.BlobClientOptions = new BlobClientOptions(); 
            });
            
            builder.StartActors((system, registry) =>
            {
                var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
                registry.Register<MyPersistenceActor>(myActor);
            });
        });
    }).Build();

A few convenience Akka.Hosting extension methods are also added as a shortcut:

var host = new HostBuilder()
    .ConfigureServices(collection =>
    {
        collection.AddAkka("MyActorSys", builder =>
        {
            var credentials = new DefaultAzureCredential();
            
            // Add the journal table
            builder.WithAzureTableJournal(
                serviceUri: new Uri("https://{account_name}.table.core.windows.net"),
                defaultAzureCredential: credentials);
            
            // Add the snapshot-store blob container
            builder.WithAzureBlobsSnapshotStore(
                serviceUri: new Uri("https://{account_name}.blob.core.windows.net"),
                defaultAzureCredential: credentials);
            
            builder.StartActors((system, registry) =>
            {
                var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
                registry.Register<MyPersistenceActor>(myActor);
            });
        });
    }).Build();

0.9.0 July 21 2022

Added Akka.Hosting support to Akka.Persistence.Azure, which you can activate via the following:

First, install the Akka.Persistence.Azure.Hosting NuGet package:

PS> install-package Akka.Persistence.Azure.Hosting

Next, add the WithAzurePersistence method calls to your AkkaConfigurationBuilder (from Akka.Hosting):

var conn = Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR");
var host = new HostBuilder()
    .ConfigureServices(collection =>
    {
        collection.AddAkka("MyActorSys", builder =>
        {
        	// enables both journal and snapshot store
            builder.WithAzurePersistence(conn);
            builder.StartActors((system, registry) =>
            {
                var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
                registry.Register<MyPersistenceActor>(myActor);
            });
        });
    }).Build();

await host.StartAsync();
return host;

You can also call the following methods to activate the journal / snapshot stores independently:

  • WithAzureTableJournal
  • WithAzureBlobsSnapshotStore

0.8.4 June 2 2022

0.8.3 September 9 2021

0.8.2 April 20 2021

Release of Akka.Persistence.Azure

Changes:

  • 0bf73aa Update RELEASE_NOTES.md for 1.5.13 release (#344)
  • c31fd64 Bump Azure.Storage.Blobs from 12.15.1 to 12.18.0 (#337)
  • def4a65 Modernize solution (#343)
  • 4a8bd5f Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.7.2 (#335)
  • 163b2ff Bump Azure.Data.Tables from 12.8.0 to 12.8.1 (#333)
  • 590a2e9 Bump xunit from 2.5.0 to 2.5.1 (#339)
  • 81580a6 Bump AkkaHostingVersion from 1.5.8.1 to 1.5.13 (#342)
  • 173fe16 Bump Azure.Identity from 1.9.0 to 1.10.1 (#338)
  • d387ce0 Bump AkkaVersion from 1.5.11 to 1.5.13 (#341)
  • 629df07 Bump xunit.runner.visualstudio from 2.5.0 to 2.5.1 (#340)
See More
  • 3026d13 Bump AkkaVersion from 1.5.10 to 1.5.11 (#328)
  • 450a762 Bump AkkaVersion from 1.5.8 to 1.5.10 (#327)
  • e15b808 Bump AkkaHostingVersion from 1.5.8 to 1.5.8.1 (#325)
  • 71c8167 Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#323)
  • e15e81d Bump xunit from 2.4.2 to 2.5.0 (#322)
  • fc8f9d0 Bump Microsoft.NET.Test.Sdk from 17.6.0 to 17.6.3 (#321)
  • 551f628 Bump AkkaHostingVersion from 1.5.7 to 1.5.8 (#320)
  • 5bc0b50 Bump AkkaVersion from 1.5.7 to 1.5.8 (#319)
  • dedb956 Bump AkkaHostingVersion from 1.5.6.1 to 1.5.7 (#316)
  • c8d169b Bump Docker.DotNet from 3.125.14 to 3.125.15 (#313)
  • 69ff064 Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.0 (#312)
  • e3a7b97 Bump Azure.Identity from 1.8.2 to 1.9.0 (#311)
  • b3349a5 Bump AkkaHostingVersion from 1.5.6 to 1.5.6.1 (#315)
  • 727f91a Bump AkkaVersion from 1.5.6 to 1.5.7 (#314)
  • a58ddf8 Bump AkkaHostingVersion from 1.5.4.1 to 1.5.6 (#310)
  • d2ee5da Bump AkkaVersion from 1.5.4 to 1.5.6 (#309)
  • 7610e92 Bump Docker.DotNet from 3.125.13 to 3.125.14 (#302)
  • beece38 Bump AkkaVersion from 1.5.1 to 1.5.4 (#304)
  • afbbe85 Bump AkkaHostingVersion from 1.5.1.1 to 1.5.4.1 (#306)
  • d79e228 Bump AkkaHostingVersion from 1.5.1 to 1.5.1.1 (#298)
  • d5b6137 Bump Azure.Storage.Blobs from 12.15.0 to 12.15.1 (#297)
  • 4e46ee0 Bump AkkaHostingVersion from 1.5.0 to 1.5.1 (#296)

This list of changes was auto generated.