akka.persistence
Class AbstractPersistentActorWithAtLeastOnceDelivery

java.lang.Object
  extended by akka.actor.AbstractActor
      extended by akka.persistence.AbstractPersistentActor
          extended by akka.persistence.AbstractPersistentActorWithAtLeastOnceDelivery
All Implemented Interfaces:
Actor, Stash, StashFactory, StashSupport, UnrestrictedStash, RequiresMessageQueue<DequeBasedMessageQueueSemantics>, AtLeastOnceDelivery, Eventsourced, PersistentActor, Processor, ProcessorImpl, Recovery, Snapshotter

public abstract class AbstractPersistentActorWithAtLeastOnceDelivery
extends AbstractPersistentActor
implements AtLeastOnceDelivery

Java API compatible with lambda expressions

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

See Also:
AtLeastOnceDelivery

Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.persistence.AtLeastOnceDelivery
AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot, AtLeastOnceDelivery.AtLeastOnceDeliverySnapshot$, AtLeastOnceDelivery.Internal$, AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException, AtLeastOnceDelivery.UnconfirmedDelivery, AtLeastOnceDelivery.UnconfirmedDelivery$, AtLeastOnceDelivery.UnconfirmedWarning, AtLeastOnceDelivery.UnconfirmedWarning$
 
Nested classes/interfaces inherited from interface akka.persistence.Recovery
Recovery.State
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Nested classes/interfaces inherited from interface akka.persistence.Eventsourced
Eventsourced.PendingHandlerInvocation
 
Constructor Summary
AbstractPersistentActorWithAtLeastOnceDelivery()
           
 
Method Summary
 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.
 
Methods inherited from class akka.persistence.AbstractPersistentActor
defer, defer, persist, persist, persistAsync, persistAsync, receive
 
Methods inherited from class akka.actor.AbstractActor
emptyBehavior, getContext, receive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.persistence.AtLeastOnceDelivery
aroundPostStop, aroundPreRestart, aroundReceive, confirmDelivery, defaultMaxUnconfirmedMessages, defaultRedeliverInterval, defaultWarnAfterNumberOfUnconfirmedAttempts, deliver, deliverySequenceNr, getDeliverySnapshot, maxUnconfirmedMessages, nextDeliverySequenceNr, numberOfUnconfirmed, redeliverInterval, redeliverOverdue, redeliverTask, send, setDeliverySnapshot, unconfirmed, warnAfterNumberOfUnconfirmedAttempts
 
Methods inherited from interface akka.persistence.Processor
persistenceId
 
Methods inherited from interface akka.persistence.ProcessorImpl
_persistenceId, aroundPreStart, deleteMessage, deleteMessage, deleteMessages, deleteMessages, flushJournalBatch, initializing, instanceId, nextSequenceNr, onRecoveryCompleted, onRecoveryFailure, onReplayFailure, onReplaySuccess, preRestart, preRestartDefault, preStart, processing, processorBatch, processorId, recoveryFinished, recoveryRunning, sequenceNr, snapshotterId, unhandled, unstashFilterPredicate
 
Methods inherited from interface akka.persistence.Recovery
_currentPersistent, _currentState, _lastSequenceNr, _recoveryFailureCause, _recoveryFailureMessage, currentPersistentMessage, extension, getCurrentPersistentMessage, journal, lastSequenceNr, prepareRestart, receiverStash, recoveryPending, recoveryStarted, replayFailed, replayStarted, runReceive, snapshotSequenceNr, updateLastSequenceNr, updateLastSequenceNr, withCurrentPersistent
 
Methods inherited from interface akka.persistence.Snapshotter
deleteSnapshot, deleteSnapshots, loadSnapshot, saveSnapshot, snapshotStore
 
Methods inherited from interface akka.actor.UnrestrictedStash
postStop
 
Methods inherited from interface akka.actor.Actor
aroundPostRestart, context, postRestart, receive, self, sender, supervisorStrategy
 
Methods inherited from interface akka.actor.StashSupport
actorCell, capacity, clearStash, context, enqueueFirst, mailbox, prepend, self, stash, theStash, unstash, unstashAll, unstashAll
 
Methods inherited from interface akka.actor.StashFactory
createStash
 
Methods inherited from interface akka.persistence.Eventsourced
aroundPreRestart, aroundReceive, currentState, defer, defer, flushBatch, initialBehavior, pendingInvocations, pendingStashingPersistInvocations, persist, persist, persistAsync, persistAsync, persistingEvents, postStop, preRestart, processingCommands, processorStash, receiveCommand, receiveRecover, recovering, recoveryBehavior, resequenceableEventBatch, unstashAll, useProcessorBatching
 

Constructor Detail

AbstractPersistentActorWithAtLeastOnceDelivery

public AbstractPersistentActorWithAtLeastOnceDelivery()
Method Detail

deliver

public 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. It will retry sending the message until the delivery is confirmed with AtLeastOnceDelivery.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 numberOfUnconfirmed is greater than or equal to AtLeastOnceDelivery.maxUnconfirmedMessages().

Parameters:
destination - (undocumented)
deliveryIdToMessage - (undocumented)