Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2017-12-18 Thread Michael Zhong
case SaveSnapshotSuccess(metadata) => println(s"snapshot saved. seqNum:${metadata.sequenceNr}, timeStamp:${metadata.timestamp}") deleteMessages(metadata.sequenceNr - eventDeleteOffset) Isn't this falsey? event is about snapshot, deleteMessages(..) is about snapshot, they are

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2015-12-14 Thread Patrik Nordwall
Thanks for sharing, Brice. That is an important finding. On Wed, Dec 2, 2015 at 2:23 PM, Brice Figureau wrote: > On 18/02/2014 21:39, dpenn...@good-cloud.com wrote: > > I would assume that a common scenario is to periodically snapshot state > > and keep 1 or more

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2015-12-02 Thread Brice Figureau
On 18/02/2014 21:39, dpenn...@good-cloud.com wrote: > I would assume that a common scenario is to periodically snapshot state > and keep 1 or more snapshots. In this case, I assume that as you delete > older snapshots, you would also delete messages older than the snapshot > from the journal in

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2014-09-18 Thread Brian McGee
Hey, I'm implementing a PersistentActor which batches writes for a db. After successfully writing a batch I can't figure out how to determine the latest message number I should use to pass to deleteMessages to prevent the events I just persisted to the db from appearing in the recovery. Any

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2014-09-18 Thread danny . browning
Make sure you're receiving the snapshot success message. case SaveSnapshotSuccess(metadata) = { deleteMessages(metadata.sequenceNr, true) } You can also save that metadata in case you want to clean up snapshots. Per Patrik's comment, you may want to verify that some interval has passed

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2014-02-19 Thread dpennell
Agreed - in our legacy system, we have a storage manager that removes old journals and snapshots as space is needed. The old journals are sometimes very useful for postmortem analysis. -david On Wednesday, February 19, 2014 2:45:17 AM UTC-5, Patrik Nordwall wrote: You can use deleteMessages

[akka-user] akka.persistence, snapshots and deleting messages from journal

2014-02-18 Thread dpennell
I would assume that a common scenario is to periodically snapshot state and keep 1 or more snapshots. In this case, I assume that as you delete older snapshots, you would also delete messages older than the snapshot from the journal in order to keep the journal from growing indefinitely. Is

Re: [akka-user] akka.persistence, snapshots and deleting messages from journal

2014-02-18 Thread Patrik Nordwall
You can use deleteMessages to delete all messages up to a specified sequence number. I would not use it too eagerly, since the information in the history can be valuable in itself, but that is of course depending on the application. /Patrik On Tue, Feb 18, 2014 at 9:39 PM,