Package org.acemq.amqp.patterns
Class SagaResult
java.lang.Object
org.acemq.amqp.patterns.SagaResult
What a saga did.
Returned rather than thrown, because a failed saga is not an exceptional condition to a
caller that has to decide what happens next — and because the interesting part is not the
exception but unresolved(), the list of things that could not be undone.
-
Method Details
-
isComplete
public boolean isComplete()- Returns:
- whether every step ran
-
compensated
public boolean compensated()- Returns:
- whether a step failed and the earlier ones were undone
-
failedAt
- Returns:
- the step that failed, when one did
-
failure
- Returns:
- why it failed
-
completed
- Returns:
- the steps that ran, in order, before the failure
-
unresolved
The steps whose compensation failed.This is the list to alert on. Everything else a saga reports is recoverable by construction; these are real-world effects that happened, were meant to be undone, and were not. Nothing else in the system knows about them, and no retry will resolve them — a person has to.
- Returns:
- the steps a human now has to reconcile, in the order compensation was attempted
-
hasUnresolved
public boolean hasUnresolved()- Returns:
- whether anything was left in a state nobody intended
-
toString
-