You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2023/12/08 14:21:47 UTC
[PR] [DRAFT] support reading akka-persistence snapshots [incubator-pekko]
pjfanning opened a new pull request, #837:
URL: https://github.com/apache/incubator-pekko/pull/837
* aim is to get this working for 1.0.x and forward for to main branch
* see https://github.com/scullxbones/pekko-persistence-mongo/pull/14#issuecomment-1847223850
@SakulK would you be able to share a persisted akka snapshot? In base64 format, maybe. It would be useful to have some sort of test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] [DRAFT] support reading akka-persistence snapshots [incubator-pekko]
Posted by "SakulK (via GitHub)" <gi...@apache.org>.
SakulK commented on PR #837:
URL: https://github.com/apache/incubator-pekko/pull/837#issuecomment-1847320309
Here, along with the code to generate it:
```
package akka.persistence
import akka.actor.ActorSystem
import akka.serialization.{ SerializationExtension, SerializerWithStringManifest }
import akka.persistence.serialization.Snapshot
import akka.persistence.fsm.PersistentFSM.PersistentFSMSnapshot
import java.util.Base64
object MakeTestSnapshot extends App {
val system = ActorSystem()
val serialization = SerializationExtension(system)
val bytes = serialization.serialize(Snapshot(PersistentFSMSnapshot[String]("test-identifier", "test-data", None)))
val base64 = Base64.getEncoder.encode(bytes.get)
println(new String(base64)) // PAAAAAcAAABha2thLnBlcnNpc3RlbmNlLmZzbS5QZXJzaXN0ZW50RlNNJFBlcnNpc3RlbnRGU01TbmFwc2hvdAoPdGVzdC1pZGVudGlmaWVyEg0IFBIJdGVzdC1kYXRh
}
```
and test deserialization on pekko:
```
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.serialization.{ SerializationExtension, SerializerWithStringManifest }
import java.util.Base64
import org.apache.pekko.persistence.serialization.Snapshot
val system = ActorSystem()
val serialization = SerializationExtension(system)
val bytes = Base64.getDecoder.decode("PAAAAAcAAABha2thLnBlcnNpc3RlbmNlLmZzbS5QZXJzaXN0ZW50RlNNJFBlcnNpc3RlbnRGU01TbmFwc2hvdAoPdGVzdC1pZGVudGlmaWVyEg0IFBIJdGVzdC1kYXRh")
val result = serialization.deserialize(bytes, classOf[Snapshot])
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] support reading akka-persistence snapshots [incubator-pekko]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #837:
URL: https://github.com/apache/incubator-pekko/pull/837
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org