Packages

p

akka

persistence

package persistence

Content Hierarchy
Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package fsm
  2. package japi
  3. package journal
  4. package query
  5. package scalatest
  6. package serialization
  7. package snapshot
  8. package state
  9. package testkit
  10. package typed

Type Members

  1. abstract class AbstractPersistentActor extends AbstractActor with AbstractPersistentActorLike

    Java API: an persistent actor - can be used to implement command or Event Sourcing.

  2. abstract class AbstractPersistentActorWithAtLeastOnceDelivery extends AbstractPersistentActor with AtLeastOnceDeliveryLike

    Java API: compatible with lambda expressions

    Java API: compatible with lambda expressions

    Use this class instead of AbstractPersistentActor to send messages with at-least-once delivery semantics to destinations. Full documentation in AtLeastOnceDelivery.

    See also

    AtLeastOnceDelivery

    AtLeastOnceDeliveryLike

  3. abstract class AbstractPersistentActorWithTimers extends AbstractActor with Timers with AbstractPersistentActorLike

    Java API: Combination of AbstractPersistentActor and akka.actor.AbstractActorWithTimers.

  4. trait AtLeastOnceDelivery extends PersistentActor with AtLeastOnceDeliveryLike

    Scala API: Mix-in this trait with your PersistentActor to send messages with at-least-once delivery semantics to destinations.

    Scala API: Mix-in this trait with your PersistentActor to send messages with at-least-once delivery semantics to destinations. It takes care of re-sending messages when they have not been confirmed within a configurable timeout. Use the AtLeastOnceDeliveryLike#deliver method to send a message to a destination. Call the AtLeastOnceDeliveryLike#confirmDelivery method when the destination has replied with a confirmation message.

    At-least-once delivery implies that original message send order is not always retained and the destination may receive duplicate messages due to possible resends.

    The interval between redelivery attempts can be defined by AtLeastOnceDeliveryLike#redeliverInterval. After a number of delivery attempts a AtLeastOnceDelivery.UnconfirmedWarning message will be sent to self. The re-sending will still continue, but you can choose to call AtLeastOnceDeliveryLike#confirmDelivery to cancel the re-sending.

    The AtLeastOnceDelivery trait has a state consisting of unconfirmed messages and a sequence number. It does not store this state itself. You must persist events corresponding to the deliver and confirmDelivery invocations from your PersistentActor so that the state can be restored by calling the same methods during the recovery phase of the PersistentActor. Sometimes these events can be derived from other business level events, and sometimes you must create separate events. During recovery calls to deliver will not send out the message, but it will be sent later if no matching confirmDelivery was performed.

    Support for snapshots is provided by AtLeastOnceDeliveryLike#getDeliverySnapshot and AtLeastOnceDeliveryLike#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.

    See also

    AtLeastOnceDeliveryLike

    AbstractPersistentActorWithAtLeastOnceDelivery for Java API

  5. trait AtLeastOnceDeliveryLike extends Eventsourced

  6. final case class AtomicWrite(payload: Seq[PersistentRepr]) extends PersistentEnvelope with Message with Product with Serializable
  7. sealed abstract class CapabilityFlag extends AnyRef
  8. sealed trait CapabilityFlags extends AnyRef
  9. final case class DeleteMessagesFailure(cause: Throwable, toSequenceNr: Long) extends Response with Product with Serializable

    Reply message to a failed JournalProtocol.DeleteMessagesTo request.

  10. final case class DeleteMessagesSuccess(toSequenceNr: Long) extends Response with Product with Serializable

    Reply message to a successful JournalProtocol.DeleteMessagesTo request.

  11. final case class DeleteSnapshotFailure(metadata: SnapshotMetadata, cause: Throwable) extends Response with Product with Serializable

    Sent to a PersistentActor after failed deletion of a snapshot.

    Sent to a PersistentActor after failed deletion of a snapshot.

    metadata

    snapshot metadata.

    cause

    failure cause.

    Annotations
    @SerialVersionUID()
  12. final case class DeleteSnapshotSuccess(metadata: SnapshotMetadata) extends Response with Product with Serializable

    Sent to a PersistentActor after successful deletion of a snapshot.

    Sent to a PersistentActor after successful deletion of a snapshot.

    metadata

    snapshot metadata.

    Annotations
    @SerialVersionUID()
  13. final case class DeleteSnapshotsFailure(criteria: SnapshotSelectionCriteria, cause: Throwable) extends Response with Product with Serializable

    Sent to a PersistentActor after failed deletion of a range of snapshots.

    Sent to a PersistentActor after failed deletion of a range of snapshots.

    criteria

    snapshot selection criteria.

    cause

    failure cause.

    Annotations
    @SerialVersionUID()
  14. final case class DeleteSnapshotsSuccess(criteria: SnapshotSelectionCriteria) extends Response with Product with Serializable

    Sent to a PersistentActor after successful deletion of specified range of snapshots.

    Sent to a PersistentActor after successful deletion of specified range of snapshots.

    criteria

    snapshot selection criteria.

    Annotations
    @SerialVersionUID()
  15. final class DiscardConfigurator extends StashOverflowStrategyConfigurator
  16. trait JournalCapabilityFlags extends CapabilityFlags
  17. class Persistence extends Extension

    Persistence extension.

  18. trait PersistenceIdentity extends AnyRef

    Identification of PersistentActor.

  19. trait PersistenceRecovery extends AnyRef
  20. final class PersistenceSettings extends AnyRef

    Persistence configuration.

  21. trait PersistenceStash extends Stash with StashFactory
  22. trait PersistentActor extends Eventsourced with PersistenceIdentity

    Scala API: A persistent Actor - can be used to implement command or Event Sourcing.

  23. trait PersistentRepr extends Message

    Plugin API: representation of a persistent message in the journal plugin API.

    Plugin API: representation of a persistent message in the journal plugin API.

    Annotations
    @DoNotInherit()
    See also

    akka.persistence.journal.AsyncWriteJournal

    akka.persistence.journal.AsyncRecovery

  24. abstract class PluginSpec extends TestKitBase with AnyWordSpecLike with Matchers with BeforeAndAfterAll with BeforeAndAfterEach
  25. final case class Recovery(fromSnapshot: SnapshotSelectionCriteria = SnapshotSelectionCriteria.Latest, toSequenceNr: Long = Long.MaxValue, replayMax: Long = Long.MaxValue) extends Product with Serializable

    Recovery mode configuration object to be returned in PersistentActor#recovery.

    Recovery mode configuration object to be returned in PersistentActor#recovery.

    By default recovers from latest snapshot replays through to the last available event (last sequenceId).

    Recovery will start from a snapshot if the persistent actor has previously saved one or more snapshots and at least one of these snapshots matches the specified fromSnapshot criteria. Otherwise, recovery will start from scratch by replaying all stored events.

    If recovery starts from a snapshot, the persistent actor is offered that snapshot with a SnapshotOffer message, followed by replayed messages, if any, that are younger than the snapshot, up to the specified upper sequence number bound (toSequenceNr).

    fromSnapshot

    criteria for selecting a saved snapshot from which recovery should start. Default is latest (= youngest) snapshot.

    toSequenceNr

    upper sequence number bound (inclusive) for recovery. Default is no upper bound.

    replayMax

    maximum number of messages to replay. Default is no limit.

    Annotations
    @SerialVersionUID()
  26. abstract class RecoveryCompleted extends AnyRef
  27. final class RecoveryTimedOut extends RuntimeException with NoStackTrace
  28. final case class ReplyToStrategy(response: Any) extends StashOverflowStrategy with Product with Serializable

    Reply to sender with predefined response, and discard the received message silently.

    Reply to sender with predefined response, and discard the received message silently.

    response

    the message replying to sender with

  29. trait RuntimePluginConfig extends AnyRef
  30. final case class SaveSnapshotFailure(metadata: SnapshotMetadata, cause: Throwable) extends Response with Product with Serializable

    Sent to a PersistentActor after failed saving of a snapshot.

    Sent to a PersistentActor after failed saving of a snapshot.

    metadata

    snapshot metadata.

    cause

    failure cause.

    Annotations
    @SerialVersionUID()
  31. final case class SaveSnapshotSuccess(metadata: SnapshotMetadata) extends Response with Product with Serializable

    Sent to a PersistentActor after successful saving of a snapshot.

    Sent to a PersistentActor after successful saving of a snapshot.

    metadata

    snapshot metadata.

    Annotations
    @SerialVersionUID()
  32. final case class SelectedSnapshot(metadata: SnapshotMetadata, snapshot: Any) extends Product with Serializable

    Plugin API: a selected snapshot matching SnapshotSelectionCriteria.

    Plugin API: a selected snapshot matching SnapshotSelectionCriteria.

    metadata

    snapshot metadata.

    snapshot

    snapshot.

  33. final class SerializedEvent extends AnyRef

    Some journal implementations may support events of this type by writing the event payload and serialization information without having to serialize it.

  34. final class SnapshotMetadata extends Product3[String, Long, Long] with Serializable

    Snapshot metadata.

    Snapshot metadata.

    Annotations
    @SerialVersionUID()
  35. final case class SnapshotOffer(metadata: SnapshotMetadata, snapshot: Any) extends Product with Serializable

    Offers a PersistentActor a previously saved snapshot during recovery.

    Offers a PersistentActor a previously saved snapshot during recovery. This offer is received before any further replayed messages.

    Annotations
    @SerialVersionUID()
  36. final case class SnapshotSelectionCriteria(maxSequenceNr: Long = Long.MaxValue, maxTimestamp: Long = Long.MaxValue, minSequenceNr: Long = 0L, minTimestamp: Long = 0L) extends Product with Serializable

    Selection criteria for loading and deleting snapshots.

    Selection criteria for loading and deleting snapshots.

    maxSequenceNr

    upper bound for a selected snapshot's sequence number. Default is no upper bound, i.e. Long.MaxValue

    maxTimestamp

    upper bound for a selected snapshot's timestamp. Default is no upper bound, i.e. Long.MaxValue

    minSequenceNr

    lower bound for a selected snapshot's sequence number. Default is no lower bound, i.e. 0L

    minTimestamp

    lower bound for a selected snapshot's timestamp. Default is no lower bound, i.e. 0L

    Annotations
    @SerialVersionUID()
    See also

    Recovery

  37. trait SnapshotStoreCapabilityFlags extends CapabilityFlags
  38. trait Snapshotter extends Actor

    Snapshot API on top of the internal snapshot protocol.

  39. sealed trait StashOverflowStrategy extends AnyRef

    This defines how to handle the current received message which failed to stash, when the size of Stash exceeding the capacity of Stash.

  40. trait StashOverflowStrategyConfigurator extends AnyRef

    Implement this interface in order to configure the stashOverflowStrategy for the internal stash of persistent actor.

    Implement this interface in order to configure the stashOverflowStrategy for the internal stash of persistent actor. An instance of this class must be instantiable using a no-arg constructor.

  41. final case class TestPayload(ref: ActorRef) extends Product with Serializable
  42. class TestSerializer extends SerializerWithStringManifest
  43. final class ThrowExceptionConfigurator extends StashOverflowStrategyConfigurator

Value Members

  1. object AtLeastOnceDelivery
    Annotations
    @ccompatUsedUntil213()
  2. object AtomicWrite extends Serializable
  3. object CapabilityFlag
  4. case object DiscardToDeadLetterStrategy extends StashOverflowStrategy with Product with Serializable

    Discard the message to akka.actor.DeadLetter.

  5. case object FilteredPayload extends Product with Serializable

    In some use cases with projections and events by slice filtered events needs to be stored in the journal to keep the sequence numbers for a given persistence id gap free.

    In some use cases with projections and events by slice filtered events needs to be stored in the journal to keep the sequence numbers for a given persistence id gap free. This placeholder payload is used for those cases and serialized down to a 0-byte representation when stored in the database.

    This payload is not in general expected to show up for users but in some scenarios/queries it may.

    In the typed queries EventEnvelope this should be flagged as filtered and turned into a non-present payload by the query plugin implementations.

  6. object Persistence extends ExtensionId[Persistence] with ExtensionIdProvider

    Persistence extension provider.

  7. object PersistentRepr extends Serializable
  8. object Recovery extends Serializable
  9. case object RecoveryCompleted extends RecoveryCompleted with Product with Serializable

    Sent to a PersistentActor when the journal replay has been finished.

    Sent to a PersistentActor when the journal replay has been finished.

    Annotations
    @SerialVersionUID()
  10. object SelectedSnapshot extends Serializable
  11. object SnapshotMetadata extends AbstractFunction3[String, Long, Long, SnapshotMetadata] with Serializable
  12. object SnapshotSelectionCriteria extends Serializable
  13. case object ThrowOverflowExceptionStrategy extends StashOverflowStrategy with Product with Serializable

    Throw akka.actor.StashOverflowException, hence the persistent actor will starting recovery if guarded by default supervisor strategy.

    Throw akka.actor.StashOverflowException, hence the persistent actor will starting recovery if guarded by default supervisor strategy. Be carefully if used together with persist/persistAll or has many messages needed to replay.

Ungrouped