Hey!
I have an actor that extends AbstractPersistentActorWithAtLeastOnceDelivery
which works fine. I have been adding snapshotting saving/deleting where I
save for instance a list of buffered messages. I then came across this in
the documentation:
Support for snapshots is provided by getDeliverySnapshot and
setDeliverySnapshot. The AtLeastOnceDeliverySnapshot contains the full
delivery state, including unconfirmed messages. If you need a custom
snapshot for other parts of the actor state you must also include the
AtLeastOnceDeliverySnapshot. It is serialized using protobuf with the
ordinary Akka serialization mechanism. It is easiest to include the bytes
of the AtLeastOnceDeliverySnapshot as a blob in your custom snapshot.
After reading the above, I decided to also save the
AtLeastOnceDeliverySnapshot object to my custom DTO which aslo just has a
list of buffered messages. However, including the AtLeastOnceDeliverySnapshot
in another object always causes the recovery to fail (when running a test)
with this error:
FlowSourceActor: Persistence failure when replaying events for
persistenceId [killedDuringBufferingAndRestoredToCorrectStateFromSnapshot].
Last known sequence number [0]
scala.MatchError: None (of class scala.None$)
at
akka.persistence.cassandra.snapshot.CassandraSnapshotStore$SnapshotDeserializer.hasMetaColumns(CassandraSnapshotStore.scala:298)
~[akka-persistence-cassandra_2.12-0.80.jar:?]
at
akka.persistence.cassandra.snapshot.CassandraSnapshotStore$SnapshotDeserializer.deserializeSnapshot(CassandraSnapshotStore.scala:311)
~[akka-persistence-cassandra_2.12-0.80.jar:?]
at
akka.persistence.cassandra.snapshot.CassandraSnapshotStore.$anonfun$load1Async$3(CassandraSnapshotStore.scala:156)
~[akka-persistence-cassandra_2.12-0.80.jar:?]
at scala.util.Success.$anonfun$map$1(Try.scala:251)
~[scala-library-2.12.4.jar:?]
at scala.util.Success.map(Try.scala:209) ~[scala-library-2.12.4.jar:?]
at scala.concurrent.Future.$anonfun$map$1(Future.scala:289)
~[scala-library-2.12.4.jar:?]
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
~[scala-library-2.12.4.jar:?]
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
~[scala-library-2.12.4.jar:?]
at scala.concurrent.impl.CallbackRunnable.run$$$capture(Promise.scala:60)
~[scala-library-2.12.4.jar:?]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala)
~[scala-library-2.12.4.jar:?]
at
akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
~[akka-actor_2.12-2.5.9.jar:?]
at
akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
~[akka-actor_2.12-2.5.9.jar:?]
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
~[scala-library-2.12.4.jar:?]
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
~[scala-library-2.12.4.jar:?]
at
akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
~[akka-actor_2.12-2.5.9.jar:?]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
~[akka-actor_2.12-2.5.9.jar:?]
at
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)
~[akka-actor_2.12-2.5.9.jar:?]
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[akka-actor_2.12-2.5.9.jar:?]
at
akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[akka-actor_2.12-2.5.9.jar:?]
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[akka-actor_2.12-2.5.9.jar:?]
Am I doing something wrong? I can't find any example on how to include
AtLeastOnceDeliverySnapshot
as a blob in my custom object which looks like this (I'm using Kotlin):
data class SnapshotBufferedMessagesDto(
@Tag(10)
val bufferedMessages: ArrayDeque<MessageEnvelopeDto>,
@Tag(11)
val atLeastOnceDeliverySnapshot:
AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot
) : Dto
Any guidance is appreciated. Thanks!
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.