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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$Nested classes/interfaces inherited from interface org.apache.pekko.persistence.Eventsourced
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.State -
Method Summary
Modifier and TypeMethodDescriptionvoidINTERNAL APIvoidaroundPreRestart(Throwable reason, scala.Option<Object> message) INTERNAL APIvoidaroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> receive, Object message) INTERNAL APIvoidbooleanconfirmDelivery(long deliveryId) Call this method when a message has been confirmed by the destination, or to abort re-sending.voiddeliverySequenceNr_$eq(long x$1) Full state of theAtLeastOnceDelivery.voidinternalDeliver(ActorPath destination, scala.Function1<Object, Object> deliveryIdToMessage) INTERNAL APIvoidinternalDeliver(ActorSelection destination, scala.Function1<Object, Object> deliveryIdToMessage) INTERNAL APIintMaximum number of unconfirmed messages that this actor is allowed to hold in memory.longintNumber of messages that have not been confirmed yet.voidINTERNAL API.scala.concurrent.duration.FiniteDurationInterval between redelivery attempts.voidvoidredeliverTask_$eq(scala.Option<Cancellable> x$1) intMaximum number of unconfirmed messages that will be sent at each redelivery burst (burst frequency is half of the redelivery interval).voidsend(long deliveryId, org.apache.pekko.persistence.AtLeastOnceDelivery.Internal.Delivery d, long timestamp) voidIf snapshot fromgetDeliverySnapshot()was saved it will be received during recovery in aSnapshotOffermessage and should be set with this method.voidvoidINTERNAL APIvoidsuper$aroundPreRestart(Throwable reason, scala.Option<Object> message) INTERNAL APIvoidsuper$aroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> receive, Object message) INTERNAL APIvoidvoidunconfirmed_$eq(scala.collection.immutable.SortedMap<Object, org.apache.pekko.persistence.AtLeastOnceDelivery.Internal.Delivery> x$1) intAfter this number of delivery attempts anAtLeastOnceDelivery.UnconfirmedWarningmessage will be sent toself.Methods inherited from interface org.apache.pekko.actor.Actor
context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preStart, receive, self, sender, supervisorStrategyMethods inherited from interface org.apache.pekko.persistence.Eventsourced
_lastSequenceNr_$eq, aroundPostRestart, aroundPreStart, batchAtomicWrite, changeState, currentState_$eq, deleteMessages, eventBatch_$eq, flushBatch, flushJournalBatch, internalDefer, internalDeferAsync, internalDeleteMessagesBeforeSnapshot, internalPersist, internalPersistAll, internalPersistAllAsync, internalPersistAsync, journal, journalBatch_$eq, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, peekApplyHandler, pendingStashingPersistInvocations_$eq, receiveCommand, receiveRecover, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, sendBatchedEventsToJournal, sequenceNr_$eq, setLastSequenceNr, snapshotSequenceNr, snapshotStore, snapshotterId, startRecovery, stash, stashInternally, super$aroundPostRestart, super$aroundPreStart, super$stash, super$unhandled, unhandled, unstashAll, unstashInternally, updateLastSequenceNr, waitingRecoveryPermit, writeEventFailed, writeEventRejected, writeEventSucceeded, writeInProgress_$eqMethods inherited from interface org.apache.pekko.persistence.PersistenceIdentity
journalPluginId, persistenceId, snapshotPluginIdMethods inherited from interface org.apache.pekko.persistence.PersistenceRecovery
recoveryMethods inherited from interface org.apache.pekko.persistence.PersistenceStash
internalStashOverflowStrategyMethods inherited from interface org.apache.pekko.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshotMethods inherited from interface org.apache.pekko.actor.StashFactory
createStashMethods inherited from interface org.apache.pekko.actor.StashSupport
actorCell, clearStash, context, enqueueFirst, mailbox, org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq, prepend, self, theStash_$eq, unstash, unstashAllMethods inherited from interface org.apache.pekko.actor.UnrestrictedStash
postStop, preRestart, super$postStop, super$preRestart
-
Method Details
-
aroundPostStop
void aroundPostStop()INTERNAL API- Specified by:
aroundPostStopin interfaceActor- Specified by:
aroundPostStopin interfaceEventsourced
-
aroundPreRestart
INTERNAL API- Specified by:
aroundPreRestartin interfaceActor- Specified by:
aroundPreRestartin interfaceEventsourced
-
aroundReceive
INTERNAL API- Specified by:
aroundReceivein interfaceActor- Specified by:
aroundReceivein interfaceEventsourced- 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:
truethe first time thedeliveryIdis confirmed, i.e.falsefor duplicate confirm- See Also:
-
#deliver
-
deliverySequenceNr_$eq
void deliverySequenceNr_$eq(long x$1) -
getDeliverySnapshot
AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot getDeliverySnapshot()Full state of theAtLeastOnceDelivery. It can be saved withSnapshotter.saveSnapshot(java.lang.Object). During recovery the snapshot received inSnapshotOffershould be set withsetDeliverySnapshot(org.apache.pekko.persistence.AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot).The
AtLeastOnceDeliverySnapshotcontains the full delivery state, including unconfirmed messages. If you need a custom snapshot for other parts of the actor state you must also include theAtLeastOnceDeliverySnapshot. It is serialized using protobuf with the ordinary Akka serialization mechanism. It is easiest to include the bytes of theAtLeastOnceDeliverySnapshotas a blob in your custom snapshot. -
internalDeliver
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#deliverwill not accept more messages and it will throwAtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException.The default value can be configured with the
pekko.persistence.at-least-once-delivery.max-unconfirmed-messagesconfiguration 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:EventsourcedINTERNAL API. Called whenever a message replay succeeds. May be implemented by subclass.- Specified by:
onReplaySuccessin interfaceEventsourced
-
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-intervalconfiguration key. This method can be overridden by implementation classes to return non-default values. -
redeliverOverdue
void redeliverOverdue() -
redeliverTask_$eq
-
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-limitconfiguration 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
If snapshot fromgetDeliverySnapshot()was saved it will be received during recovery in aSnapshotOffermessage and should be set with this method. -
startRedeliverTask
void startRedeliverTask() -
super$aroundPostStop
void super$aroundPostStop()INTERNAL API- Specified by:
super$aroundPostStopin interfaceEventsourced
-
super$aroundPreRestart
INTERNAL API- Specified by:
super$aroundPreRestartin interfaceEventsourced
-
super$aroundReceive
void super$aroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> receive, Object message) INTERNAL API- Specified by:
super$aroundReceivein interfaceEventsourced
-
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 anAtLeastOnceDelivery.UnconfirmedWarningmessage will be sent toself. 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-attemptsconfiguration key. This method can be overridden by implementation classes to return non-default values.
-