public abstract class UntypedPersistentActorWithAtLeastOnceDelivery extends UntypedPersistentActor implements AtLeastOnceDeliveryLike
UntypedPersistentActor
to send messages
with at-least-once delivery semantics to destinations.
Full documentation in AtLeastOnceDelivery
.
AtLeastOnceDelivery
,
AtLeastOnceDeliveryLike
Eventsourced.AsyncHandlerInvocation, Eventsourced.AsyncHandlerInvocation$, Eventsourced.PendingHandlerInvocation, Eventsourced.RecoveryTick, Eventsourced.RecoveryTick$, Eventsourced.StashingHandlerInvocation, Eventsourced.StashingHandlerInvocation$, Eventsourced.State
Actor.emptyBehavior$, Actor.ignoringBehavior$
Constructor and Description |
---|
UntypedPersistentActorWithAtLeastOnceDelivery() |
Modifier and Type | Method and Description |
---|---|
void |
deliver(ActorPath destination,
Function<java.lang.Long,java.lang.Object> deliveryIdToMessage)
Java API: Send the message created by the
deliveryIdToMessage function to
the destination actor. |
void |
deliver(ActorSelection destination,
Function<java.lang.Long,java.lang.Object> deliveryIdToMessage)
Java API: Send the message created by the
deliveryIdToMessage function to
the destination actor. |
deferAsync, journal, mailbox, onReceive, onReceiveCommand, onReceiveRecover, persist, persist, persistAll, persistAllAsync, persistAsync, receiveCommand, receiveRecover, snapshotStore
context, getContext, getSelf, getSender, postRestart, postStop, preRestart, preStart, receive, self, supervisorStrategy, unhandled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aroundPostStop, aroundPreRestart, aroundReceive, confirmDelivery, deliver, deliver, getDeliverySnapshot, maxUnconfirmedMessages, nextDeliverySequenceNr, numberOfUnconfirmed, onReplaySuccess, redeliverInterval, redeliverOverdue, redeliveryBurstLimit, send, setDeliverySnapshot, startRedeliverTask, warnAfterNumberOfUnconfirmedAttempts
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
public UntypedPersistentActorWithAtLeastOnceDelivery()
public void deliver(ActorPath destination, Function<java.lang.Long,java.lang.Object> deliveryIdToMessage)
deliveryIdToMessage
function to
the destination
actor. It will retry sending the message until
the delivery is confirmed with AtLeastOnceDeliveryLike.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, 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 AtLeastOnceDeliveryLike.numberOfUnconfirmed()
is greater than or equal to AtLeastOnceDeliveryLike.maxUnconfirmedMessages()
.
destination
- (undocumented)deliveryIdToMessage
- (undocumented)public void deliver(ActorSelection destination, Function<java.lang.Long,java.lang.Object> deliveryIdToMessage)
deliveryIdToMessage
function to
the destination
actor. It will retry sending the message until
the delivery is confirmed with AtLeastOnceDeliveryLike.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, 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 AtLeastOnceDeliveryLike.numberOfUnconfirmed()
is greater than or equal to AtLeastOnceDeliveryLike.maxUnconfirmedMessages()
.
destination
- (undocumented)deliveryIdToMessage
- (undocumented)