dmSelf is used as the address where the DM-confirmation-messages should be sent. In a sharding environment, this has to be our dispatcher which knows how to reach the sharding mechanism. If null, we'll fallback to self - useful when testing
If doUnconfirmedWarningProcessing is turned on, then override this method to try to do something useful before we give up
If doUnconfirmedWarningProcessing is turned on, then override this method to try to do something useful before we give up
Override this to decide if the failed outbound durableMessage should result in a persisted event.
Override this to decide if the failed outbound durableMessage should result in a persisted event. If so, return these events. When these have been persisted, generateDMs() will be called as usual enabling you to perform some outbound action.
Called when actor has been idle for too long..
Called when actor has been idle for too long..
If running in sharding, you should stop like this:
getContext().parent().tell(new ShardRegion.Passivate(PoisonPill.getInstance()), self());
Used when processing events live - not recovering
Used when recovering events
Used when processing commands
(Since version 2.4) use persistAll instead
(Since version 2.4) use persistAllAsync instead
Dispatcher - When sending something to an ES, use its dispatcher Command - Dispatchable message - When sent to the dispatcher, it will be sent to the correct ES.
Event - Represents a change of state for an ES
State is immutable. Represents the full state of the entity. based on its state it can accept or reject an event. Has with method transition(event) - if ok, it returns new state. If not, an error is thrown.
Can be used to try an event (since it is mutable)
DurableMessage: method of sending a message which with retry-mechanism until confirm() is called.
GeneralAggregate pseudocode:
for each received cmd: convert it to event try the event (by calling state.transition() ) if it failed: maybe do something if it works: persist event generate and send DurableMessages change our current state (by calling state.transition() and keeping the result )
Superclass/trait representing your events
The type representing your state