public interface AtLeastOnceDeliveryLike extends Eventsourced
AtLeastOnceDelivery
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.State
Actor.emptyBehavior$, Actor.ignoringBehavior$
Modifier and Type | Method and Description |
---|---|
void |
aroundPostStop()
INTERNAL API
|
void |
aroundPreRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message)
INTERNAL API
|
void |
aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive,
java.lang.Object message)
INTERNAL API
|
boolean |
confirmDelivery(long deliveryId)
Call this method when a message has been confirmed by the destination,
or to abort re-sending.
|
void |
deliver(ActorPath destination,
scala.Function1<java.lang.Object,java.lang.Object> deliveryIdToMessage)
Scala API: Send the message created by the
deliveryIdToMessage function to
the destination actor. |
void |
deliver(ActorSelection destination,
scala.Function1<java.lang.Object,java.lang.Object> deliveryIdToMessage)
Scala API: Send the message created by the
deliveryIdToMessage function to
the destination actor. |
AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot |
getDeliverySnapshot()
Full state of the
AtLeastOnceDelivery . |
int |
maxUnconfirmedMessages()
Maximum number of unconfirmed messages that this actor is allowed to hold in memory.
|
long |
nextDeliverySequenceNr() |
int |
numberOfUnconfirmed()
Number of messages that have not been confirmed yet.
|
void |
onReplaySuccess()
INTERNAL API.
|
scala.concurrent.duration.FiniteDuration |
redeliverInterval()
Interval between redelivery attempts.
|
void |
redeliverOverdue() |
int |
redeliveryBurstLimit()
Maximum number of unconfirmed messages that will be sent at each redelivery burst
(burst frequency is half of the redelivery interval).
|
void |
send(long deliveryId,
akka.persistence.AtLeastOnceDelivery.Internal.Delivery d,
long timestamp) |
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. |
void |
startRedeliverTask() |
int |
warnAfterNumberOfUnconfirmedAttempts()
After this number of delivery attempts an
AtLeastOnceDelivery.UnconfirmedWarning message
will be sent to self . |
aroundPostRestart, aroundPreStart, changeState, deferAsync, deleteMessages, flushBatch, flushJournalBatch, journal, lastSequenceNr, log, nextSequenceNr, onPersistFailure, onPersistRejected, onRecoveryFailure, peekApplyHandler, persist, persist, persistAll, persistAllAsync, persistAsync, persistAsync, receiveCommand, receiveRecover, recovering, recoveryFinished, recoveryRunning, recoveryStarted, requestRecoveryPermit, setLastSequenceNr, snapshotSequenceNr, snapshotStore, snapshotterId, startRecovery, stashInternally, unhandled, unstashAll, unstashInternally, updateLastSequenceNr, waitingRecoveryPermit
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot
internalStashOverflowStrategy
context, postRestart, preStart, receive, self, sender, supervisorStrategy
actorCell, clearStash, context, enqueueFirst, mailbox, prepend, self, stash, unstash, unstashAll
createStash
journalPluginId, persistenceId, snapshotPluginId
recovery
scala.concurrent.duration.FiniteDuration redeliverInterval()
The default value can be configured with the
akka.persistence.at-least-once-delivery.redeliver-interval
configuration key. This method can be overridden by implementation classes to return
non-default values.
int redeliveryBurstLimit()
The default value can be configured with the
akka.persistence.at-least-once-delivery.redelivery-burst-limit
configuration key. This method can be overridden by implementation classes to return
non-default values.
int warnAfterNumberOfUnconfirmedAttempts()
AtLeastOnceDelivery.UnconfirmedWarning
message
will be sent to self
. The count is reset after a restart.
The default value can be configured with the
akka.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.
int maxUnconfirmedMessages()
deliver(akka.actor.ActorPath, scala.Function1<java.lang.Object, java.lang.Object>)
will not accept more messages and it will throw
AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException
.
The default value can be configured with the
akka.persistence.at-least-once-delivery.max-unconfirmed-messages
configuration key. This method can be overridden by implementation classes to return
non-default values.
void startRedeliverTask()
long nextDeliverySequenceNr()
void deliver(ActorPath destination, scala.Function1<java.lang.Object,java.lang.Object> deliveryIdToMessage)
deliveryIdToMessage
function to
the destination
actor. It will retry sending the message until
the delivery is confirmed with confirmDelivery(long)
. Correlation
between deliver
and confirmDelivery
is performed with the
deliveryId
that is provided as parameter to the deliveryIdToMessage
function. The deliveryId
is typically passed in the message to the
destination, which replies with a message containing the same deliveryId
.
The deliveryId
is a strictly monotonically increasing sequence number without
gaps. The same sequence is used for all destinations of the actor, i.e. when sending
to multiple destinations the destinations will see gaps in the sequence if no
translation is performed.
During recovery this method will not send out the message, but it will be sent
later if no matching confirmDelivery
was performed.
This method will throw AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException
if numberOfUnconfirmed()
is greater than or equal to maxUnconfirmedMessages()
.
destination
- (undocumented)deliveryIdToMessage
- (undocumented)void deliver(ActorSelection destination, scala.Function1<java.lang.Object,java.lang.Object> deliveryIdToMessage)
deliveryIdToMessage
function to
the destination
actor. It will retry sending the message until
the delivery is confirmed with confirmDelivery(long)
. Correlation
between deliver
and confirmDelivery
is performed with the
deliveryId
that is provided as parameter to the deliveryIdToMessage
function. The deliveryId
is typically passed in the message to the
destination, which replies with a message containing the same deliveryId
.
The deliveryId
is a strictly monotonically increasing sequence number without
gaps. The same sequence is used for all destinations of the actor, i.e. when sending
to multiple destinations the destinations will see gaps in the sequence if no
translation is performed.
During recovery this method will not send out the message, but it will be sent
later if no matching confirmDelivery
was performed.
This method will throw AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException
if numberOfUnconfirmed()
is greater than or equal to maxUnconfirmedMessages()
.
destination
- (undocumented)deliveryIdToMessage
- (undocumented)boolean confirmDelivery(long deliveryId)
deliveryId
- (undocumented)true
the first time the deliveryId
is confirmed, i.e. false
for duplicate confirmdeliver(akka.actor.ActorPath, scala.Function1<java.lang.Object, java.lang.Object>)
int numberOfUnconfirmed()
void redeliverOverdue()
void send(long deliveryId, akka.persistence.AtLeastOnceDelivery.Internal.Delivery d, long timestamp)
AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot getDeliverySnapshot()
AtLeastOnceDelivery
. It can be saved with Snapshotter.saveSnapshot(java.lang.Object)
.
During recovery the snapshot received in SnapshotOffer
should be set
with setDeliverySnapshot(akka.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.
void setDeliverySnapshot(AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot snapshot)
getDeliverySnapshot()
was saved it will be received during recovery
in a SnapshotOffer
message and should be set with this method.snapshot
- (undocumented)void aroundPreRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
aroundPreRestart
in interface Actor
aroundPreRestart
in interface Eventsourced
reason
- (undocumented)message
- (undocumented)void aroundPostStop()
aroundPostStop
in interface Actor
aroundPostStop
in interface Eventsourced
void onReplaySuccess()
Eventsourced
onReplaySuccess
in interface Eventsourced
void aroundReceive(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> receive, java.lang.Object message)
aroundReceive
in interface Actor
aroundReceive
in interface Eventsourced
receive
- (undocumented)message
- (undocumented)