org.axonframework.commandhandling.disruptor
Class AggregateStateCorruptedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.common.AxonException
org.axonframework.common.AxonTransientException
org.axonframework.commandhandling.disruptor.AggregateStateCorruptedException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- AggregateBlacklistedException
public class AggregateStateCorruptedException
- extends AxonTransientException
Exception indicating that the changes in an aggregate (generated events) are ignored by the DisruptorCommandBus,
because it cannot guarantee that these changes have been applied to an aggregate instance with the correct state.
The DisruptorCommandBus will automatically recover by clearing cached information of blacklisted aggregates. Because
of the asynchronous nature of the DisruptorCommandBus, several commands may fail due to the same corrupt aggregate.
When a corrupt aggregate has been detected, a AggregateBlacklistedException
is thrown. Each subsequent time
state changes are applied to a blacklisted aggregate, an AggregateStateCorruptedException is thrown.
It is generally safe to retry any commands that resulted in this exception, unless the cause is clearly
non-transient.
- Since:
- 2.0
- Author:
- Allard Buijze
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
AggregateStateCorruptedException
public AggregateStateCorruptedException(Object aggregateIdentifier,
String message)
- Initializes the exception with given
aggregateIdentifier
and given explanatory
message
.
- Parameters:
aggregateIdentifier
- The identifier of the blacklisted aggregatemessage
- The message explaining why the blacklisting occurred
AggregateStateCorruptedException
public AggregateStateCorruptedException(Object aggregateIdentifier,
String message,
Throwable cause)
- Initializes the exception with given
aggregateIdentifier
, given explanatory message
and cause
.
- Parameters:
aggregateIdentifier
- The identifier of the blacklisted aggregatemessage
- The message explaining why the blacklisting occurredcause
- The cause of the blacklist
getAggregateIdentifier
public Object getAggregateIdentifier()
- Returns the identifier of the blacklisted aggregate.
- Returns:
- the identifier of the blacklisted aggregate
Copyright © 2010-2016. All Rights Reserved.