diff --git a/akka-docs/rst/java/lambda-persistence.rst b/akka-docs/rst/java/lambda-persistence.rst index c308bf466d..31222837dd 100644 --- a/akka-docs/rst/java/lambda-persistence.rst +++ b/akka-docs/rst/java/lambda-persistence.rst @@ -255,12 +255,13 @@ single command). Message deletion ---------------- -A persistent actor can delete a single message by calling the ``deleteMessage`` method with the sequence number of -that message as argument. An optional ``permanent`` parameter specifies whether the message shall be permanently +To delete all messages (journaled by a single persistent actor) up to a specified sequence number, +persistent actors may call the ``deleteMessages`` method. + +An optional ``permanent`` parameter specifies whether the message shall be permanently deleted from the journal or only marked as deleted. In both cases, the message won't be replayed. Later extensions to Akka persistence will allow to replay messages that have been marked as deleted which can be useful for debugging -purposes, for example. To delete all messages (journaled by a single persistent actor) up to a specified sequence number, -persistent actors should call the ``deleteMessages`` method. +purposes, for example. .. _persistent-views-java-lambda: diff --git a/akka-docs/rst/java/persistence.rst b/akka-docs/rst/java/persistence.rst index 6bd49c195f..296061ad9f 100644 --- a/akka-docs/rst/java/persistence.rst +++ b/akka-docs/rst/java/persistence.rst @@ -261,12 +261,13 @@ single command). Message deletion ---------------- -A persistent actor can delete a single message by calling the ``deleteMessage`` method with the sequence number of -that message as argument. An optional ``permanent`` parameter specifies whether the message shall be permanently +To delete all messages (journaled by a single persistent actor) up to a specified sequence number, +persistent actors may call the ``deleteMessages`` method. + +An optional ``permanent`` parameter specifies whether the message shall be permanently deleted from the journal or only marked as deleted. In both cases, the message won't be replayed. Later extensions to Akka persistence will allow to replay messages that have been marked as deleted which can be useful for debugging -purposes, for example. To delete all messages (journaled by a single persistent actor) up to a specified sequence number, -persistent actors should call the ``deleteMessages`` method. +purposes, for example. .. _persistent-views-java: diff --git a/akka-docs/rst/project/migration-guide-persistence-experimental-2.3.x-2.4.x.rst b/akka-docs/rst/project/migration-guide-persistence-experimental-2.3.x-2.4.x.rst index 762c76374b..377d4ae38c 100644 --- a/akka-docs/rst/project/migration-guide-persistence-experimental-2.3.x-2.4.x.rst +++ b/akka-docs/rst/project/migration-guide-persistence-experimental-2.3.x-2.4.x.rst @@ -1,8 +1,8 @@ .. _migration-guide-persistence-experimental-2.3.x-2.4.x: -##################################################### -Migration Guide Akka Persistence (experimental) 2.3.3 -##################################################### +########################################################################## +Migration Guide Akka Persistence (experimental) 2.3.3 to 2.3.4 (and 2.4.x) +########################################################################## **Akka Persistence** is an **experimental module**, which means that neither Binary Compatibility nor API stability is provided for Persistence while under the *experimental* flag. The goal of this phase is to gather user feedback @@ -122,6 +122,17 @@ Using the``PersistentActor`` instead of ``Processor`` also shifts the responsibi to the receiver instead of the sender of the message. Previously, using ``Processor``, clients would have to wrap messages as ``Persistent(cmd)`` manually, as well as have to be aware of the receiver being a ``Processor``, which didn't play well with transparency of the ActorRefs in general. +Removed deleteMessage +===================== + +``deleteMessage`` is deprecated and will be removed. When using command sourced ``Processor`` the command was stored before it was +received and could be validated and then there was a reason to remove faulty commands to avoid repeating the error during replay. +When using ``PersistentActor`` you can always validate the command before persisting and therefore the stored event (or command) +should always be valid for replay. + +``deleteMessages`` can still be used for pruning of all messages up to a sequence number. + + Renamed View to PersistentView, which receives plain messages (Persistent() wrapper is gone) ============================================================================================ Views used to receive messages wrapped as ``Persistent(payload, seqNr)``, this is no longer the case and views receive diff --git a/akka-docs/rst/scala/persistence.rst b/akka-docs/rst/scala/persistence.rst index 8b4f832e92..e8406262b0 100644 --- a/akka-docs/rst/scala/persistence.rst +++ b/akka-docs/rst/scala/persistence.rst @@ -257,14 +257,13 @@ single command). Message deletion ---------------- -A persistent actor can delete a single message by calling the ``deleteMessage`` method with the sequence number of -that message as argument. An optional ``permanent`` parameter specifies whether the message shall be permanently +To delete all messages (journaled by a single persistent actor) up to a specified sequence number, +persistent actors may call the ``deleteMessages`` method. + +An optional ``permanent`` parameter specifies whether the message shall be permanently deleted from the journal or only marked as deleted. In both cases, the message won't be replayed. Later extensions to Akka persistence will allow to replay messages that have been marked as deleted which can be useful for debugging -purposes, for example. To delete all messages (journaled by a single persistent actor) up to a specified sequence number, -persistent actors should call the ``deleteMessages`` method. - - +purposes, for example. .. _persistent-views: diff --git a/akka-persistence/src/main/scala/akka/persistence/Processor.scala b/akka-persistence/src/main/scala/akka/persistence/Processor.scala index 465c72790d..60f141b814 100644 --- a/akka-persistence/src/main/scala/akka/persistence/Processor.scala +++ b/akka-persistence/src/main/scala/akka/persistence/Processor.scala @@ -205,6 +205,7 @@ private[akka] trait ProcessorImpl extends Actor with Recovery { * * @param sequenceNr sequence number of the persistent message to be deleted. */ + @deprecated("deleteMessage(sequenceNr) will be removed. Instead, validate before persist, and use deleteMessages for pruning.", since = "2.3.4") def deleteMessage(sequenceNr: Long): Unit = { deleteMessage(sequenceNr, permanent = false) } @@ -220,6 +221,7 @@ private[akka] trait ProcessorImpl extends Actor with Recovery { * @param sequenceNr sequence number of the persistent message to be deleted. * @param permanent if `false`, the message is marked as deleted, otherwise it is permanently deleted. */ + @deprecated("deleteMessage(sequenceNr) will be removed. Instead, validate before persist, and use deleteMessages for pruning.", since = "2.3.4") def deleteMessage(sequenceNr: Long, permanent: Boolean): Unit = { journal ! DeleteMessages(List(PersistenceIdImpl(persistenceId, sequenceNr)), permanent) }