Class EventBatchTooLargeException
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
The exception thrown when a single atomic append exceeds the maximum number of events a provider can write in one all-or-nothing operation.
public sealed class EventBatchTooLargeException : ArgumentOutOfRangeException, ISerializable
- Inheritance
-
EventBatchTooLargeException
- Implements
- Inherited Members
Remarks
Some event stores impose a hard cap on the number of events in a single atomic append (for example,
Amazon DynamoDB's TransactWriteItems caps at 100 items and offers no larger atomic primitive).
Splitting the append across multiple calls would risk a torn event-stream prefix, which event sourcing
must never produce, so a batch above the cap is rejected up front rather than partially written.
This is a caller/usage error — the client asked for something the provider cannot do atomically — so it derives from ArgumentOutOfRangeException and is surfaced as a thrown exception rather than a returned AppendResult failure. Callers split the append into batches of at most MaxBatchSize events, or opt into a provider's non-atomic path where one is offered.
Constructors
EventBatchTooLargeException()
Initializes a new instance of the EventBatchTooLargeException class.
public EventBatchTooLargeException()
EventBatchTooLargeException(string)
Initializes a new instance of the EventBatchTooLargeException class with a message.
public EventBatchTooLargeException(string message)
Parameters
messagestringA message describing the limit and how to work within it.
EventBatchTooLargeException(string, Exception?)
Initializes a new instance of the EventBatchTooLargeException class with a message and an inner exception.
public EventBatchTooLargeException(string message, Exception? innerException)
Parameters
messagestringA message describing the limit and how to work within it.
innerExceptionExceptionThe exception that is the cause of the current exception.
EventBatchTooLargeException(string?, int, int, string)
Initializes a new instance of the EventBatchTooLargeException class.
public EventBatchTooLargeException(string? paramName, int actualCount, int maxBatchSize, string message)
Parameters
paramNamestringThe name of the parameter that carried the oversized batch.
actualCountintThe number of events the caller attempted to append atomically.
maxBatchSizeintThe maximum number of events the provider can append in one atomic operation.
messagestringA message describing the limit and how to work within it.
Properties
ActualCount
Gets the number of events the caller attempted to append in a single atomic operation.
public int ActualCount { get; }
Property Value
- int
The attempted event count, or
0when not specified.
MaxBatchSize
Gets the maximum number of events the provider can append in one atomic operation.
public int MaxBatchSize { get; }
Property Value
- int
The provider's per-append atomic limit, or
0when not specified.