Open Andycharalambous opened 3 years ago
Some more information:
EDIT: was able to get TransactionalWriteStrategy to work - i've looked at it's constructor signature vs RowIdUpdatingStrategy and SingleThreadedBatchWriteStrategy and they are identical :-/
Ok - so i'm way off about it being a constructor signature thing. I found this in the logs:
Caused by: java.lang.UnsupportedOperationException: cannot create top-level actor [AkkaPgRowIdUpdater] from the outside on ActorSystem with custom user guardian at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:890) at akka.persistence.pg.journal.RowIdUpdatingStrategy.<init>(WriteStrategy.scala:106) ... 31 common frames omitted
So when using the RowIdUpdatingStrategy, it fails during the creation of the internal actor it uses. This might be an akka 2.6 issue or something I'm doing when I bootstrap the application by messing with the user guardian? I don't believe I am - I'm using typed actors, and have to have a single point of entry actor - thats just how it works.
I think the solution here is to use systemActorOf(...) instead of actorOf(...) when running in a typed actor system. I can't downgrade to classic akka, so I'm not sure how to proceed - genuine issue or akka 2.6 not supported yet?
EDIT: obviously I've never written an akka extension - systemActorOf is only available to extensions (I think). I'm stumped on this - i'll have to use something else (table-lock strategy is no-go for me - cockroachdb doesn't support table locks)
The following method in PluginConfig.scala throws
java.lang.reflect.InvocationTargetException: null
when any WriteStrategy except the default is configured:
writestrategy = "akka.persistence.pg.journal.RowIdUpdatingStrategy"