Skip to content

Commit

Permalink
Update RELEASE_NOTES.md for 0.5.0 release (#122)
Browse files Browse the repository at this point in the history
* Update RELEASE_NOTES.md for 0.5.0 release

* Remove trailing whitespaces

* Fix RELEASE_NOTES
  • Loading branch information
Arkatufus authored Oct 4, 2022
1 parent cf87206 commit 3f89a3a
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,101 @@
## [0.5.0] / 9 October 2022
* [Update Akka.NET from 1.4.41 to 1.4.43](https://github.com/akkadotnet/akka.net/releases/tag/1.4.43)
* [Add full options support to Akka.Persistence.SqlServer.Hosting](https://github.com/akkadotnet/Akka.Hosting/pull/107)
* [Improved Akka.Remote.Hosting implementation](https://github.com/akkadotnet/Akka.Hosting/pull/108)
* [Add a standardized option code pattern for Akka.Hosting developer](https://github.com/akkadotnet/Akka.Hosting/pull/110)
* [Add Akka.Hosting.TestKit module for unit testing projects using Akka.Hosting](https://github.com/akkadotnet/Akka.Hosting/pull/102)

**Add full options support to Akka.Persistence.SqlServer.Hosting**

You can now use an option class in Akka.Persistence.SqlServer.Hosting to replace HOCON configuration fully.

**Add Akka.Hosting.TestKit module**

The biggest difference between _Akka.Hosting.TestKit_ and _Akka.TestKit_ is that, since the test is started asynchronously, the _TestKit_ properties and methods would not be available in the unit test class constructor anymore. Since the spec depends on Microsoft `HostBuilder`, configuration has to be broken down into steps. There are overridable methods that user can use to override virtually all of the setup process.

These are steps of what overridable methods gets called. Not all of the methods needs to be overriden, at the minimum, if you do not need a custom hosting environment, you need to override the `ConfigureAkka` method.

1. `ConfigureLogging(ILoggingBuilder)`

Add custom logger and filtering rules on the `HostBuilder` level.
2. `ConfigureHostConfiguration(IConfigurationBuilder)`

Inject any additional hosting environment configuration here, such as faking environment variables, in the `HostBuilder` level.
3. `ConfigureAppConfiguration(HostBuilderContext, IConfigurationBuilder)`

Inject the application configuration.
4. `ConfigureServices(HostBuilderContext, IServiceCollection)`

Add additional services needed by the test, such as mocked up services used inside the dependency injection.
5. User defined HOCON configuration is injected by overriding the `Config` property, it is not passed as part of the constructor anymore.
6. `ConfigureAkka(AkkaConfigurationBuilder, IServiceProvider)`

This is called inside `AddAkka`, use this to configure the `AkkaConfigurationBuilder`
7. `BeforeTestStart()`

This method is called after the TestKit is initialized. Move all of the codes that used to belong in the constructor here.

`Akka.Hosting.TestKit` extends `Akka.TestKit.TestKitBase` directly, all testing methods are available out of the box.
All of the properties, such as `Sys` and `TestActor` will be available once the unit test class is invoked.

**Add a standardized option code pattern for Akka.Hosting developer**

This new feature is intended for Akka.Hosting module developer only, it is used to standardize how Akka.Hosting addresses a very common HOCON configuration pattern. This allows for a HOCON-less programmatic setup replacement for the HOCON path used to configure the HOCON property.

The pattern:

```text
# This HOCON property references to a config block below
akka.discovery.method = akka.discovery.config
akka.discovery.config {
class = "Akka.Discovery.Config.ConfigServiceDiscovery, Akka.Discovery"
# other options goes here
}
```

Example implementation:
```csharp
// The base class for the option, needs to implement the IHoconOption template interface
public abstract class DiscoveryOptionBase : IHoconOption
{ }

// The actual option implementation
public class ConfigOption : DiscoveryOptionBase
{
// The path value in the akka.discovery.method property above
public string ConfigPath => "akka.discovery.config";

// The FQCN value in the akka.discovery.config.class property above
public Type Class => typeof(ConfigServiceDiscovery);

// Generate the same HOCON config as above
public void Apply(AkkaConfigurationBuilder builder, Setup setup = null)
{
// Modifies Akka.NET configuration either via HOCON or setup class
builder.AddHocon(
$"akka.discovery.method = {ConfigPath.ToHocon()}",
HoconAddMode.Prepend);
builder.AddHocon($"akka.discovery.config.class = {
Class.AssemblyQualifiedName.ToHocon()}",
HoconAddMode.Prepend);

// Rest of configuration goes here
}
}

// Akka.Hosting extension implementation
public static AkkaConfigurationBuilder WithDiscovery(
this AkkaConfigurationBuilder builder,
DiscoveryOptionBase discOption)
{
var setup = new DiscoverySetup();

// gets called here
discOption.Apply(builder, setup);
}
```

## [0.4.3] / 9 September 2022
- [Update Akka.NET from 1.4.40 to 1.4.41](https://github.com/akkadotnet/akka.net/releases/tag/1.4.41)
- [Cluster.Hosting: Add split-brain resolver support](https://github.com/akkadotnet/Akka.Hosting/pull/95)
Expand Down

0 comments on commit 3f89a3a

Please sign in to comment.