Class 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:
  • Constructor Details

    • AggregateStateCorruptedException

      public AggregateStateCorruptedException(String aggregateIdentifier, String message)
      Initializes the exception with given aggregateIdentifier and given explanatory message.
      Parameters:
      aggregateIdentifier - The identifier of the blacklisted aggregate
      message - The message explaining why the blacklisting occurred
    • AggregateStateCorruptedException

      public AggregateStateCorruptedException(String aggregateIdentifier, String message, Throwable cause)
      Initializes the exception with given aggregateIdentifier, given explanatory message and cause.
      Parameters:
      aggregateIdentifier - The identifier of the blacklisted aggregate
      message - The message explaining why the blacklisting occurred
      cause - The cause of the blacklist
  • Method Details

    • getAggregateIdentifier

      public String getAggregateIdentifier()
      Returns the identifier of the blacklisted aggregate.
      Returns:
      the identifier of the blacklisted aggregate