You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val readJournal = PersistenceQuery(actorSystem).readJournalFor[PostgresReadJournal](PostgresReadJournal.Identifier).eventsByPersistenceId("", 0, Long.MaxValue)
val readJournalAsJsValue = readJournal.map( _.event).collect{case e : BoardEvent=> Json.parse(eventJsonEncoder.toJson(e).value) }
Flow.fromSinkAndSource(Sink.ignore, readJournalAsJsValue)
}
I got the following exception :
a.a.OneForOneStrategy - head of empty list
java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:428)
at scala.collection.immutable.Nil$.head(List.scala:425)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:588)
at akka.actor.ActorCell.invoke(ActorCell.scala:557)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:258)
at akka.dispatch.Mailbox.run(Mailbox.scala:225)
at akka.dispatch.Mailbox.exec(Mailbox.scala:235)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
java.lang.NoSuchMethodError: akka.persistence.Persistence.journalFor(Ljava/lang/String;)Lakka/actor/ActorRef;
at akka.persistence.pg.journal.query.BaseEventsPublisher.<init>(BaseEventsPublisher.scala:31)
at akka.persistence.pg.journal.query.LiveEventsByPersistenceIdPublisher.<init>(LiveEventsByPersistenceIdPublisher.scala:15)
at akka.persistence.pg.journal.query.package$EventsByPersistenceIdPublisher$.$anonfun$props$3(package.scala:44)
at akka.actor.TypedCreatorFunctionConsumer.produce(IndirectActorProducer.scala:87)
at akka.actor.Props.newActor(Props.scala:212)
at akka.actor.ActorCell.newActor(ActorCell.scala:624)
at akka.actor.ActorCell.create(ActorCell.scala:650)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:523)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:545)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:283)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:235)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Persistence(context.system).journalFor(writeJournalPluginId) is a private API.
Is there a workaround ?
i use :
akka 2.5.14
akka-persistence-pg 0.10.0
Scala 2.12
The text was updated successfully, but these errors were encountered:
Thanks for you answer 👍
I made tests with versions from 2.5.10 to 2.5.17, same error.
Do you know if i can use a workaround ?
I replaced val journal: ActorRef = Persistence(context.system).journalFor(writeJournalPluginId)
by val journal: ActorRef = PersistenceQuery(context.system).readJournalFor(writeJournalPluginId)
Hello,
I prepare a workshop on akka-persistence (Code is available here : https://github.com/dgouyette/workshop-akka-persistence )
When i use the ReadJournal :
I got the following exception :
Persistence(context.system).journalFor(writeJournalPluginId)
is a private API.Is there a workaround ?
i use :
The text was updated successfully, but these errors were encountered: