altoo-ag/akka-kryo-serialization

Custom Kryo config should receive the ExtendedActorSystem

Closed this issue · 2 comments

(Nice library, BTW!)

I'm using the TaggedFieldSerializer for my stuff -- I'm using Kryo for Akka Persistence, so I need the tagging mechanism to provide schema evolution. I've mostly got that working, but have hit a snag: I need to use a custom Kryo initializer for that, and some of the classes I need require the ExtendedActorSystem in order to serialize properly.

(Specifically, I'm hitting this for serializing ChildActorRef, and I might submit a PR to add that to this library in the first place if you're interested. But I think the point stands more generally.)

This wouldn't have been a problem in days gone by, but in the modern Play world, the old static accessors to these things are now deprecated. For now I'm just going to work around it (I'll just do a kludge through a static member), but in principle it would be nice if the KryoSerializer detected an optional second parameter to the custom initializer, and stuffed the ActorSystem into that if so...

Additional note: okay, I might not immediately need this at all. (Realized that simply serializing ActorRef works better for my purposes than ActorPath.) So consider this a minor suggestion...

I'll close the issue for now - please open a new one if required