dnvriend / akka-persistence-inmemory

Akka-persistence-inmemory is a plugin for akka-persistence that stores journal and snapshot messages memory, which is very useful when testing persistent actors, persistent FSM and akka cluster
Apache License 2.0
134 stars 41 forks source link

no serializer for internal plugin messages #35

Closed kpbochenek closed 7 years ago

kpbochenek commented 7 years ago

During testing I have akka.actor.serialize-messages = on (with = off everything works ok) It means every message sent through tell / ask will be serialized then deserialized then placed to actor mailbox.

All my messages inherit from one trait and I provide serializer for this trait. Also akka handles it's own internal messages with custom serializer (protobuf I think).

Messages sent internally in this plugin have no defined serializer and default java serializer is used.

In my particular case I hit trouble in this line: https://github.com/dnvriend/akka-persistence-inmemory/blob/master/src/main/scala/akka/persistence/inmemory/journal/InMemoryAsyncWriteJournal.scala#L77

WriteList is sent to actor which means akka will serialize and deserialize this message. Because there is no special serializer a default java one will be used. But this object stores my classed internally which means java serializer will be applied to my classes but it will cause serialization to fail because they must be serialized with my serializer.

One possible idea could be to extend JournalCommand with NoSerializationVerificationNeeded which will force akka to skip serialization of these messages even though serialize-messages = on.

dnvriend commented 7 years ago

Thanks for the ticket, I've released v2.4.18.1 and v2.5.1.1 that should fix the issue.

kpbochenek commented 7 years ago

Thanks for quick fix! I will try bump version, switch to serialize-messages = on and let you know if it solves all problems.

kpbochenek commented 7 years ago

Not sure how it works but would it be possible to also push to mvnrepository? or is it populated with some delay and I should wait?

https://mvnrepository.com/artifact/com.github.dnvriend/akka-persistence-inmemory_2.11

dnvriend commented 7 years ago

mvn has been known to have synchronization issues, give it some time :)

kpbochenek commented 7 years ago

Forgot to respond, works perfectly, you can close this ticket,

Cheers