# Akka 2.5.22 released

**URL:** <https://discuss.akka.io/t/akka-2-5-22-released/3845>\
**Category:** Akka Libraries\
**Tags:** announcement\
**Created:** [April 3, 2019, 5:30pm UTC](https://discuss.akka.io/t/akka-2-5-22-released/3845 "2019-04-03T17:30:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patriknw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/patriknw/32/89_2.png) [@patriknw](https://discuss.akka.io/u/patriknw)\
**Post date:** [April 3, 2019, 5:30pm UTC](https://discuss.akka.io/t/akka-2-5-22-released/3845/1 "2019-04-03T17:30:36Z")

</div>

Dear hakkers,

We are pleased to announce a new patch release of Akka 2.5. Great news, with this release we have declared the  
new Actor APIs (Akka Typed) and Artery ready for use in production, more about that below.

An API for a distributed lease (lock) has been added to a new module called  
[Akka Coordination](https://doc.akka.io/docs/akka/current/coordination.html).  
The lease can be used with Cluster Sharding and Singleton, as well as Lightbend’s  
[Split Brain Resolver](https://developer.lightbend.com/docs/akka-commercial-addons/current/split-brain-resolver.html#lease)  
for additional additional safety measures for split brain scenarios. More details below.

Some other notable improvements and bug fixes in 2.5.22 are:

- Performance improvement of DNS resolution for SRV records [#25948](https://github.com/akka/akka/issues/25948)
- Simplify backoff supervision API, thanks to [@nvollmar](https://github.com/nvollmar), [#26156](https://github.com/akka/akka/issues/26156)
- Rewrite `Source.actorRef` as `GraphStage`, thanks to [@nvollmar](https://github.com/nvollmar), [#25324](https://github.com/akka/akka/issues/25324)
- New shutdown reasons added to `CoordinatedShutdown`, [#26570](https://github.com/akka/akka/pull/26570)
- Enable new serializer for `ShardRegionStats` that was added in 2.5.18, see [rolling updates](https://doc.akka.io/docs/akka/current/project/rolling-update.html#2-5-22-clustersharding-serializer-for-shardregionstats)
- Less restrictive pattern for matching SRV service names, [#26332](https://github.com/akka/akka/pull/26332)
- Fix race condition in lazy sink on immediate failure, [#25410](https://github.com/akka/akka/issues/25410)
- Rename `startContextPropagation` to `asFlowWithContext` and `endContextPropagation` to `asFlow` in `FlowWithContext`, similar for `SourceWithContext`, [#26353](https://github.com/akka/akka/pull/26353)
- Switch to Scalafmt [#26356](https://github.com/akka/akka/pull/26356)

A total of 125 issues were closed since 2.5.21. The complete list can be found on the [2.5.22 milestone](https://github.com/akka/akka/milestone/138?closed=1) on github.

## New Actor API (Akka Typed)

After much testing and intense development of a few important features we are confident that Akka Typed  
has the quality and performance to be used in production.

It’s still marked as [may change](https://doc.akka.io/docs/akka/current/common/may-change.html), which means  
that API or semantics can change without warning or deprecation period. For Akka Typed we have iterated over  
the APIs for a long time so we don’t expect any major changes, but your feedback is very much welcome. Such  
changes, if any, will be collected and performed in Akka 2.6.0 rather than in upcoming 2.5.x patch versions.  
The APIs of Akka Typed will be fully stable in Akka 2.6.0. This will give you a good period of stability  
without having to worry about changes in each version. We will of course backport critical bug fixes.

Additions and changes:

- Addition of message routers, see [documentation](https://doc.akka.io/docs/akka/current/typed/routers.html), [#25612](https://github.com/akka/akka/issues/25612)
- Support for deleting snapshots and events by introducing `RetentionCriteria`, see [documentation](https://doc.akka.io/docs/akka/current/typed/persistence-snapshot.html#snapshot-deletion), [#24698](https://github.com/akka/akka/issues/24698)
- The way to declare when snapshots should be stored changed with the new `RetentionCriteria`, see [snapshotting](https://doc.akka.io/docs/akka/current/typed/persistence-snapshot.html)
- Supervision when combining typed and typed actors changed. The default supervision for untyped actors is  
to restart where as for typed it is to stop. When combining untyped and and typed actors the default  
supervision is based on the default behavior of the child i.e. if an untyped actor creates a typed  
child, its default supervision will be to stop. If a typed actor creates an untyped child, its  
default supervision will be to restart.
- Fix memory leak in `watchWith`, thanks to [@longshorej](https://github.com/longshorej), [#26625](https://github.com/akka/akka/issues/26625)
- Prevent surprising ordering of `unstashAll` and side effects in `EventSourcedBehavior` by introducing `EffectBuilder` type, [#26489](https://github.com/akka/akka/issues/26489)
- Use signals instead of callbacks in `EventSourcedBehavior`, [#25428](https://github.com/akka/akka/issues/25428)
- Change signature of `terminate`, `whenTerminated` and `getWhenTerminated` in `ActorSystem`, [#25647](https://github.com/akka/akka/issues/25647)
- New classes for `SnapshotSelectionCriteria` and `SnapshotMetadata`, [#26536](https://github.com/akka/akka/issues/26536)
- Fix leak of timers when stopping, [#26285](https://github.com/akka/akka/issues/26285)
- Handle exceptions, unhandled, stopped, and same in `StashBuffer`
- More robust way to discard obsolete timer messages, [#26556](https://github.com/akka/akka/issues/26556)
- Access to `lastSequenceNr` from `EventSourcedBehavior`, [#25113](https://github.com/akka/akka/issues/25113)
- Support mutable state in `EventSourcedBehavior`, [#25740](https://github.com/akka/akka/issues/25740)

## Artery

After some final scalability testing we can now declare [Artery TCP](https://doc.akka.io/docs/akka/current/remoting-artery.html)  
ready to be used in production. In Akka 2.6.0 we will make the Artery TCP transport the default for actor messaging.  
See the short [migration guide](https://doc.akka.io/docs/akka/current/remoting-artery.html#migrating-from-classic-remoting)  
for how to switch. Classic remoting will be deprecated in 2.6.0 and removed earliest in 2.7.0.

Artery improves stability for systems using Akka Cluster and also has much better performance.

One thing to be aware of is that rolling update from classic remoting to Artery is not supported since the protocol  
is completely different. It will require a full cluster shutdown and new startup.

## Distributed lease

The distributed [lease](https://doc.akka.io/docs/akka/current/coordination.html#lease) can be used  
for additional additional safety measures for split brain scenarios in the following modules:

- Lightbend’s [Split Brain Resolver](https://developer.lightbend.com/docs/akka-commercial-addons/current/split-brain-resolver.html#lease). An additional safety measure so that only one SBR instance can make the decision to remain up.
- [Cluster Singleton](https://doc.akka.io/docs/akka/current/cluster-singleton.html#lease). A singleton manager can be configured to acquire a lease before creating the singleton.
- [Cluster Sharding](https://doc.akka.io/docs/akka/current/cluster-sharding.html#lease). Each shard can be configured to acquire a lease before creating entity actors.

An [implementation for Kubernetes](https://developer.lightbend.com/docs/akka-commercial-addons/current/kubernetes-lease.html)  
is available for Lightbend customers.

Note that [akka-coordination](https://doc.akka.io/docs/akka/current/coordination.html) is a new transitive dependency from  
`akka-cluster-sharding` and `akka-cluster-tools`. When using a build tool such as sbt, Maven or Gradle this dependency  
will automatically be included, otherwise you need to add it if you use Cluster Sharding or Cluster Singleton.

## Credits

For this release we had the help of 34 committers – thank you all very much!

```auto
commits added removed
     53 25442 21331 Patrik Nordwall
     28 3579 878 Johan Andrén
     20 521 283 Arnout Engelen
     18 2977 430 Christopher Batey
     13 952 869 Nicolas Vollmar
     12 837 271 Helena Edelson
      7 13 7 Yoel Garcia Diaz
      6 467 67 Luc Bourlier
      5 172 68 Gaël Bréard
      5 26 147 Johannes Rudolph
      5 26 22 Enno
      4 19 6 Varun Sivapalan
      2 36 16 Ignasi Marimon-Clos
      2 21 11 kerr
      2 3 9 Tim Moore
      2 3 3 Hungai Amuhinda
      1 86 86 Seth Tisue
      1 83 78 Heiko Seeberger
      1 91 62 Tzu-Chiao Yeh
      1 80 29 Renato Cavalcanti
      1 43 33 Yaroslav Klymko
      1 18 16 Jason Longshore
      1 9 9 Leandro
      1 11 6 daniperez
      1 12 2 Adriaan Groenenboom
      1 3 4 Dale Wijnand
      1 3 3 Yoel García Díaz
      1 2 2 zhongl
      1 4 0 James Roper
      1 1 1 Piotr Gawryś
      1 1 1 Vasilis Nicolaou
      1 1 1 Zili Chen
      1 1 1 Martynas Mickevičius
      1 1 1 Tomek Kopczynski

```

Thanks to [Lightbend](https://www.lightbend.com/) for their continued sponsorship of the Akka core  
team’s efforts. Lightbend [offers commercial support](https://www.lightbend.com/lightbend-platform-subscription)  
for Akka.

Happy hakking!

– The Akka Team
