Unfortunately, this seems to be a quite difficult thing to do in Akka. Creating an actor to manage access to a map proves quite cumbersome, and STM doesn't seem to be supported in the latest versions.
Therefore, the solution here was to choose the key for the
ConsistentHashingRouter carefully such that there would never be any race conditions when reading from and writing to a map. The map in question is a