Interface AtLeastOnceDeliveryLike

All Superinterfaces:
Actor, Eventsourced, PersistenceIdentity, PersistenceRecovery, PersistenceStash, RequiresMessageQueue<DequeBasedMessageQueueSemantics>, Snapshotter, Stash, StashFactory, StashSupport, UnrestrictedStash
All Known Subinterfaces:
AtLeastOnceDelivery
All Known Implementing Classes:
AbstractPersistentActorWithAtLeastOnceDelivery

public interface AtLeastOnceDeliveryLike extends Eventsourced
See Also:
  • Method Details

    • aroundPostStop

      void aroundPostStop()
      INTERNAL API
      Specified by:
      aroundPostStop in interface Actor
      Specified by:
      aroundPostStop in interface Eventsourced
    • aroundPreRestart

      void aroundPreRestart(Throwable reason, scala.Option<Object> message)
      INTERNAL API
      Specified by:
      aroundPreRestart in interface Actor
      Specified by:
      aroundPreRestart in interface Eventsourced
    • aroundReceive

      void aroundReceive(scala.PartialFunction<Object,scala.runtime.BoxedUnit> receive, Object message)
      INTERNAL API
      Specified by:
      aroundReceive in interface Actor
      Specified by:
      aroundReceive in interface Eventsourced
      Parameters:
      receive - current behavior.
      message - current message.
    • cancelRedeliveryTask

      void cancelRedeliveryTask()
    • confirmDelivery

      boolean confirmDelivery(long deliveryId)
      Call this method when a message has been confirmed by the destination, or to abort re-sending.
      Returns:
      true the first time the deliveryId is confirmed, i.e. false for duplicate confirm
      See Also:
      • #deliver
    • deliverySequenceNr_$eq

      void deliverySequenceNr_$eq(long x$1)
    • getDeliverySnapshot

      Full state of the AtLeastOnceDelivery. It can be saved with Snapshotter.saveSnapshot(java.lang.Object). During recovery the snapshot received in SnapshotOffer should be set with setDeliverySnapshot(org.apache.pekko.persistence.AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot).

      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.

    • internalDeliver

      void internalDeliver(ActorPath destination, scala.Function1<Object,Object> deliveryIdToMessage)
      INTERNAL API
    • internalDeliver

      void internalDeliver(ActorSelection destination, scala.Function1<Object,Object> deliveryIdToMessage)
      INTERNAL API
    • maxUnconfirmedMessages

      int maxUnconfirmedMessages()
      Maximum number of unconfirmed messages that this actor is allowed to hold in memory. If this number is exceed #deliver will not accept more messages and it will throw AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException.

      The default value can be configured with the pekko.persistence.at-least-once-delivery.max-unconfirmed-messages configuration key. This method can be overridden by implementation classes to return non-default values.

    • nextDeliverySequenceNr

      long nextDeliverySequenceNr()
    • numberOfUnconfirmed

      int numberOfUnconfirmed()
      Number of messages that have not been confirmed yet.
    • onReplaySuccess

      void onReplaySuccess()
      Description copied from interface: Eventsourced
      INTERNAL API. Called whenever a message replay succeeds. May be implemented by subclass.
      Specified by:
      onReplaySuccess in interface Eventsourced
    • redeliverInterval

      scala.concurrent.duration.FiniteDuration redeliverInterval()
      Interval between redelivery attempts.

      The default value can be configured with the pekko.persistence.at-least-once-delivery.redeliver-interval configuration key. This method can be overridden by implementation classes to return non-default values.

    • redeliverOverdue

      void redeliverOverdue()
    • redeliverTask_$eq

      void redeliverTask_$eq(scala.Option<Cancellable> x$1)
    • redeliveryBurstLimit

      int redeliveryBurstLimit()
      Maximum number of unconfirmed messages that will be sent at each redelivery burst (burst frequency is half of the redelivery interval). If there's a lot of unconfirmed messages (e.g. if the destination is not available for a long time), this helps to prevent an overwhelming amount of messages to be sent at once.

      The default value can be configured with the pekko.persistence.at-least-once-delivery.redelivery-burst-limit configuration key. This method can be overridden by implementation classes to return non-default values.

    • send

      void send(long deliveryId, org.apache.pekko.persistence.AtLeastOnceDelivery.Internal.Delivery d, long timestamp)
    • setDeliverySnapshot

      void setDeliverySnapshot(AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot snapshot)
      If snapshot from getDeliverySnapshot() was saved it will be received during recovery in a SnapshotOffer message and should be set with this method.
    • startRedeliverTask

      void startRedeliverTask()
    • super$aroundPostStop

      void super$aroundPostStop()
      INTERNAL API
      Specified by:
      super$aroundPostStop in interface Eventsourced
    • super$aroundPreRestart

      void super$aroundPreRestart(Throwable reason, scala.Option<Object> message)
      INTERNAL API
      Specified by:
      super$aroundPreRestart in interface Eventsourced
    • super$aroundReceive

      void super$aroundReceive(scala.PartialFunction<Object,scala.runtime.BoxedUnit> receive, Object message)
      INTERNAL API
      Specified by:
      super$aroundReceive in interface Eventsourced
    • super$onReplaySuccess

      void super$onReplaySuccess()
    • unconfirmed_$eq

      void unconfirmed_$eq(scala.collection.immutable.SortedMap<Object,org.apache.pekko.persistence.AtLeastOnceDelivery.Internal.Delivery> x$1)
    • warnAfterNumberOfUnconfirmedAttempts

      int warnAfterNumberOfUnconfirmedAttempts()
      After this number of delivery attempts an AtLeastOnceDelivery.UnconfirmedWarning message will be sent to self. The count is reset after a restart.

      The default value can be configured with the pekko.persistence.at-least-once-delivery.warn-after-number-of-unconfirmed-attempts configuration key. This method can be overridden by implementation classes to return non-default values.