We—the Akka committers—proudly announce the FINAL RELEASE of Akka 2.3.0, the first step of the Rollins milestone. Eight months have passed since the release of Akka 2.2.0 and much has happened in our code base.
The key features of this major release are:
- Akka Persistence
- Actor and FSM with support for Java 8 lambda syntax
- Allowing Cluster nodes to come back from the UNREACHABLE state
When migrating an existing project from Akka 2.2.x please have a look at the migration guide.
Changes Since 2.3.0-RC4
- (remote) fix possibly never-ending redelivery to nonexistant system after watch & unwatch pair
- (contrib) fix missing removal of shards after region termination in ClusterSharding
- (contrib) optimize recovery in ClusterSharding
- samples published as Activator templates
For the complete list of all 18 tickets please refer to the 2.3.0 assembla milestone.
The most exciting new feature is Akka Persistence, developed by Martin Krasser in collaboration with the Akka team. It allows stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster. The key concept behind Akka Persistence is that instead of storing an actor’s state you persist the changes that are applied to it. These changes are immutable facts that are appended to a journal, which allows for very high transaction rates and efficient replication. Stateful actors are recovered by replaying stored changes, rebuilding the actors’ internal state. Akka Persistence also supports event sourcing and provides point-to-point communication channels with at-least-once message delivery semantics.
Other Notable Features
- Actor and FSM with idiomatic Java 8 lambda support, allowing the formulation of these using a syntax which is close to Scala’s pattern matching and finally making the Finite State Machine DSL usable from Java.
- Detection of when cluster nodes become reachable again after having been unreachable, allowing the cluster to heal again. This makes the cluster more resilient to transient network failures and long garbage collection pauses.
- Routers have been cleaned up and enhanced. The routing logic has been extracted to be usable within normal actors as well. Some usability problems have been solved, such as properly rejecting invalid configuration combinations. Routees can be dynamically added and removed by sending special management messages to the router.
- Samples packaged as Typesafe Activator templates.
- Sharding of actors in a cluster. The typical use case for this feature is when you have many stateful actors that together consume more resources (e.g. memory) than fit on one machine. You need to distribute them across several nodes in the cluster and you want to be able to interact with them using their logical identifier, but without having to care about their physical location in the cluster, which might also change over time. It could for example be actors representing Aggregate Roots in Domain-Driven Design terminology.
- The experimental label is removed from Akka IO package, but the Pipeline infrastructure is discontinued. The Pipelines part of the experiment did not work out: the API is just too clunky and unintuitive. We have something brewing which will be more than just a replacement for Pipelines: inspired by RxJava we are working on implementing Reactive Streams for Akka which will allow declarative transformation of streaming data of all kinds, with proper handling of back-pressure and of course fully typed.
- OSGi support was reworked to make akka-actor an OSGi bundle while the akka-osgi bundle contains infrastructure (like a BundleDelegatingClassLoader to find reference.conf files across bundle boundaries). This team effort was supported by Sander Mak, Michael Pilquist, Raman Gupta and Christophe Pache.
- Aggregator pattern, contributed by Akara Sucharitakul.
- The application can specify custom logging Mapped Diagnostic Context (MDC) values, contributed by Gaston Tonietti.
- Possibility to pass in external execution context to actor system, contributed by Dario Rexin.
- ReliableProxy enhanced with reconnection when tunnel goes away, contributed by Eric Pederson.
- Links to source from ScalaDoc, contributed by Eugene Vigdorchik.
- Avoid loss of floating point precision in PhiAccrualFailureDetector, contributed by robdavid.
- Serialization format to actor selections, contributed by Dan Hopkins.
- Resolve high contention on unsubscribeAddresssTermination, contributed by Andrey Stepachev
- Improved semantics for BoundedBlockingQueue, contributed by Gustav Åkesson.
- Idiomatic Java 8 lambda support for persistence, contributed by Nabeel Ali Memon
- ActorSelection was made faster and not blocked by intermediate actors performing long-running tasks.
- Allow outgoing connection to a previously failed and now restarted actor system with same host and port without having to wait for the quarantine period to elapse.
- Allow actor selections in untrusted mode, restricted using a white-list.
- Fixed actor creation size and speed regression.
- Automatic removal of cluster nodes after a configured time period of unreachability (replaces the previously immediate “auto-down” feature to allow some time for nodes to come back).
- Several scalability improvements of clustering and remoting.
Akka Persistence Details
The “akka-persistence” module is published under the name “akka-persistence-experimental” to emphasize that its status is not yet final. This denomination is not due to sub-par standard of the module; the persistence support has been tested thoroughly and it works as documented. The reason for the “experimental” tag is that this rather important module is now presented to the general public for the first time, and although we have received valuable feedback from early adopters we anticipate possible API changes in order to meet all of your requirements. Work is continuing on Akka’s persistence support, and we will formally declare it officially supported and stable with the next major release—Akka 2.4. Please help us make it the best possible solution by continuing to give feedback on the mailing list and telling us what can be improved.
Key Akka Persistence features include:
- Processors: A processor is a persistent, stateful actor. Messages sent to a processor are written to a journal before its receive method is called. When a processor is started or restarted, journaled messages are replayed to that processor, so that it can recover internal state from these messages.
- Views: A view is a persistent, stateful actor that receives journaled messages that have been written by another processor. A view itself does not journal new messages, instead, it updates internal state only from a processor’s replicated message stream.
- Channels: Channels are used by processors and views to communicate with other actors. They prevent that replayed messages are redundantly delivered to these actors and provide at-least-once message delivery semantics.
- Journals: A journal stores messages that are sent to a processor. An application can control which messages are journaled and which are received by the processor without being journaled. The storage backend of a journal is pluggable. The default journal storage plugin writes to the local filesystem (using LevelDB), replicated journals are available as Community plugins.
- Snapshot stores: A snapshot store persists snapshots of a processor’s or a view’s internal state. Snapshots are used for optimizing recovery times. The storage backend of a snapshot store is pluggable. The default snapshot storage plugin writes to the local filesystem.
- Event sourcing. Based on the building blocks described above, Akka persistence provides abstractions for the development of event sourced applications.
This article gives a brief introduction to Akka Persistence. This module is based upon the former eventsourced library, a side-by-side comparison shows the numerous improvements which have been made while migrating it into Akka.
New Activator Templates
In order to get you started with these new features in no time, several new Activator templates await your exploration:
- akka-sample-fsm-java-lambda (using Java 8 lambdas)
Additional Release Details
The artifacts comprising this release have been published to https://repo1.maven.org/maven2/ and also to Maven Central. In addition, we adopted the sbt standard of encoding the Scala binary version in the artifact name, i.e. the core actor package’s artifactId is “akka-actor_2.10”.
Akka is released under the Apache V2 license.
v2.3.0 compared to Akka v2.2.4:
- 227 tickets closed, see milestones 2.3-M1, 2.3-M2, 2.3.0-RC1, 2.3.0-RC2, 2.3.0-RC3, 2.3.0-RC4 and 2.3.0 on Assembla
- 1405 files changed, 93736 insertions(+), 37082 deletions(-)
- … and a total of 46 committers!
commits added removed 161 35733 18269 Patrik Nordwall 45 35844 7722 Björn Antonsson 34 3250 9670 Endre Sándor Varga 29 22315 6186 Martin Krasser 24 341 354 Roland Kuhn 11 251 235 Viktor Klang 7 119 27 Johannes Rudolph 3 302 119 Mathias 3 29 41 Eugene Platonov 3 135 75 Marcus Ljungblad 3 32 19 Eugene Vigdorchik 3 184 34 Dario Rexin 2 2 2 Levi Notik 2 503 116 Eric Pederson 1 1 1 MariusSeritan 1 49 21 Josh Suereth 1 6 0 Mark "Justin" Waks 1 644 17 Gaston M. Tonietti 1 40 0 bryan hunt 1 16 11 Taylor Leese 1 35 23 rob.david 1 708 708 Adam Voss 1 1 1 oakwhiz 1 0 5 Nilanjan Raychaudhuri 1 1 1 Francois Armand 1 13 0 Michael Pollmeier 1 1 1 Ben McCann 1 1 1 Tomasz Nurkiewicz 1 691 0 Akara Sucharitakul 1 1 1 Jason Zaugg 1 44 16 Konrad Malawski 1 2 2 dave 1 0 50 Jonas Boner 1 33 0 Dan Hopkins 1 1 1 Luc Perkins 1 9 1 Gaetan Hervouet 1 1 1 Joa Ebert 1 8 8 dario.rexin 1 2 2 Oleg Anashkin 1 2 1 Andrey Stepachev 1 39 42 Gustav Åkesson 1 4 4 Sander Mak 1 3 1 jcranky 1 114 6 Ian Wormsbecker 1 5 0 Daniel Hobi 1 1 1 Jonas Bonér 1 1284 97 Nabeel Ali Memon 1 4 4 Przemysław Piotrowski