alstanchev / pekko-persistence-inmemory

Port of https://github.com/dnvriend/akka-persistence-inmemory to Pekko.
Apache License 2.0
6 stars 3 forks source link

Plugin initialization fails in a typed actor system #8

Closed sdeigm closed 4 days ago

sdeigm commented 3 months ago

The pekko plugin fails to initialize in a typed actor system with the failure

org.apache.pekko.actor.ActorInitializationException: pekko://SinkControllerTest/system/inmemory-journal: exception during creation, root cause message: [cannot create top-level actor [JournalStorage] from the outside on ActorSystem with custom user guardian]

That problem was already fixed in the original akka version (https://github.com/dnvriend/akka-persistence-inmemory/issues/50). The problem was then introduced again in some changes but did not make it into an official release. Since the pekko fork is orginated from these unreleased changes it contains the problem too.

The reason is the creation of the plugin actor using

val newActor = system.actorOf(props, actorName)

which should be

val newActor = system.systemActorOf(props, actorName)

in src/main/scala/io/github/alstanchev/pekko/persistence/inmemory/extension/ActorSingletonSupport.scala:18

If desired I can provide a PR that fixes the problem.

alstanchev commented 1 month ago

Hi @sdeigm a PR will be greatly apreciated.

sdeigm commented 1 month ago

Hi @alstanchev, I was on vacation for the last three weeks :-)

I just created the pull request

alstanchev commented 4 days ago

Fixed in #13