Releases: akkadotnet/akka.net
Akka.NET v0.7.1 Stable Release
Brand New F# API. The entire F# API has been updated to give it a more native F# feel while still holding true to the Erlang / Scala conventions used in actor systems. Read more about the F# API changes.
Multi-Node TestKit (Alpha). Not available yet as a NuGet package, but the first pass at the Akka.Remote.TestKit is now available from source, which allow you to test your actor systems running on multiple machines or processes.
A multi-node test looks like this
public class InitialHeartbeatMultiNode1 : InitialHeartbeatSpec
{
}
public class InitialHeartbeatMultiNode2 : InitialHeartbeatSpec
{
}
public class InitialHeartbeatMultiNode3 : InitialHeartbeatSpec
{
}
public abstract class InitialHeartbeatSpec : MultiNodeClusterSpec
The MultiNodeTestRunner looks at this, works out that it needs to create 3 processes to run 3 nodes for the test.
It executes NodeTestRunner in each process to do this passing parameters on the command line. Read more about the multi-node testkit here.
Breaking Change to the internal api: The Next
property on IAtomicCounter<T>
has been changed into the function Next()
This was done as it had side effects, i.e. the value was increased when the getter was called. This makes it very hard to debug as the debugger kept calling the property and causing the value to be increased.
Akka.Serilog SerilogLogMessageFormatter
has been moved to the namespace Akka.Logger.Serilog
(it used to be in Akka.Serilog.Event.Serilog
).
Update your using
statements from using Akka.Serilog.Event.Serilog;
to using Akka.Logger.Serilog;
.
Breaking Change to the internal api: Changed signatures in the abstract class SupervisorStrategy
. The following methods has new signatures: HandleFailure
, ProcessFailure
. If you've inherited from SupervisorStrategy
, OneForOneStrategy
or AllForOneStrategy
and overriden the aforementioned methods you need to update their signatures.
TestProbe can be implicitly casted to ActorRef. New feature. Tests requring the ActorRef
of a TestProbe
can now be simplified:
var probe = CreateTestProbe();
var sut = ActorOf<GreeterActor>();
sut.Tell("Akka", probe); // previously probe.Ref was required
probe.ExpectMsg("Hi Akka!");
Bugfix for ConsistentHashableEvenlope. When using ConsistentHashableEvenlope
in conjunction with ConsistentHashRouter
s, ConsistentHashableEvenlope
now correctly extracts its inner message instead of sending the entire ConsistentHashableEvenlope
directly to the intended routee.
Akka.Cluster group routers now work as expected. New update of Akka.Cluster - group routers now work as expected on cluster deployments. Still working on pool routers. Read more about Akka.Cluster routers here.
Akka.NET v0.7.0 Stable Release
Major new changes and additions in this release, including some breaking changes...
Akka.Cluster Support (pre-release) - Akka.Cluster is now available on NuGet as a pre-release package (has a -pre
suffix) and is available for testing. After installing the the Akka.Cluster module you can add take advantage of clustering via configuration, like so:
akka {
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
}
remote {
log-remote-lifecycle-events = DEBUG
helios.tcp {
hostname = "127.0.0.1"
port = 0
}
}
cluster {
seed-nodes = [
"akka.tcp://ClusterSystem@127.0.0.1:2551",
"akka.tcp://ClusterSystem@127.0.0.1:2552"]
auto-down-unreachable-after = 10s
}
}
And then use cluster-enabled routing on individual, named routers:
/myAppRouter {
router = consistent-hashing-pool
nr-of-instances = 100
cluster {
enabled = on
max-nr-of-instances-per-node = 3
allow-local-routees = off
use-role = backend
}
}
For more information on how clustering works, please see #400
Breaking Changes: Improved Stashing - The old WithUnboundedStash
and WithBoundedStash
interfaces have been slightly changed and the CurrentStash
property has been renamed to Stash
. Any old stashing code can be replaced with the following in order to continue working:
public IStash CurrentStash { get { return Stash; } set { Stash=value; } }
The Stash
field is now automatically populated with an appropriate stash during the actor creation process and there is no need to set this field at all yourself.
Breaking Changes: Renamed Logger Namespaces - The namespaces, DLL names, and NuGet packages for all logger add-ons have been changed to Akka.Loggers.Xyz
. Please install the latest NuGet package (and uninstall the old ones) and update your Akka HOCON configurations accordingly.
Serilog Support - Akka.NET now has an official Serilog logger that you can install via the Akka.Logger.Serilog
package. You can register the serilog logger via your HOCON configuration like this:
akka.loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
New Feature: Priority Mailbox - The PriorityMailbox
allows you to define the priority of messages handled by your actors, and this is done by creating your own subclass of either the UnboundedPriorityMailbox
or BoundedPriorityMailbox
class and implementing the PriorityGenerator
method like so:
public class ReplayMailbox : UnboundedPriorityMailbox
{
protected override int PriorityGenerator(object message)
{
if (message is HttpResponseMessage) return 1;
if (!(message is LoggedHttpRequest)) return 2;
return 3;
}
}
The smaller the return value from the PriorityGenerator
, the higher the priority of the message. You can then configure your actors to use this mailbox via configuration, using a fully-qualified name:
replay-mailbox {
mailbox-type: "TrafficSimulator.PlaybackApp.Actors.ReplayMailbox,TrafficSimulator.PlaybackApp"
}
And from this point onward, any actor can be configured to use this mailbox via Props
:
Context.ActorOf(Props.Create<ReplayActor>()
.WithRouter(new RoundRobinPool(3))
.WithMailbox("replay-mailbox"));
New Feature: Test Your Akka.NET Apps Using Akka.TestKit - We've refactored the testing framework used for testing Akka.NET's internals into a test-framework-agnostic NuGet package you can use for unit and integration testing your own Akka.NET apps. Right now we're scarce on documentation so you'll want to take a look at the tests inside the Akka.NET source for reference.
Right now we have Akka.TestKit adapters for both MSTest and XUnit, which you can install to your own project via the following:
MSTest:
install-package Akka.TestKit.VsTest
XUnit:
install-package Akka.TestKit.Xunit
New Feature: Logging to Standard Out is now done in color - This new feature can be disabled by setting StandardOutLogger.UseColors = false;
.
Colors can be customized: StandardOutLogger.DebugColor = ConsoleColor.Green;
.
If you need to print to stdout directly use Akka.Util.StandardOutWriter.Write()
instead of Console.WriteLine
, otherwise your messages might get printed in the wrong color.