Class StaleOutboxFencingTokenException
Signals that a presented fencing token was lower than the store's recorded high-water mark for the affected scope -- meaning the caller's leadership tenure has been superseded by a newer leader and the mutation must not be applied.
public sealed class StaleOutboxFencingTokenException : OutboxFenceRefusedException, ISerializable
- Inheritance
-
StaleOutboxFencingTokenException
- Implements
- Inherited Members
- Extension Methods
Remarks
This is a fail-closed signal: a caller that receives it MUST treat it as an abort of the protected operation, not as a transient error to retry with the same token.
The fenced completion contract reports a refusal in its return value -- FenceRefused -- because a void-returning mutation made "refused" and "applied" the same observation and every implementation reached for a different wrong encoding of the difference. A consumer-authored store MAY still refuse by throwing this, and the drain still handles it; a store that does so is not following the contract, but it is not silently losing messages either, which is what the return value was introduced to prevent. A learned refusal stops later admissions at the captured token or any older token in the same authority domain.
The refused and recorded tokens on this type have no counterpart on the returned outcome. Read the store's recorded mark through GetFencingHighWaterAsync(CancellationToken) instead; that member exists for exactly this question and answers it without a refusal having to occur.
Constructors
StaleOutboxFencingTokenException()
Initializes a new instance of the StaleOutboxFencingTokenException class.
public StaleOutboxFencingTokenException()
StaleOutboxFencingTokenException(string)
Initializes a new instance of the StaleOutboxFencingTokenException class with a message.
public StaleOutboxFencingTokenException(string message)
Parameters
messagestringThe error message.
StaleOutboxFencingTokenException(string, Exception)
Initializes a new instance of the StaleOutboxFencingTokenException class with a message and an inner exception.
public StaleOutboxFencingTokenException(string message, Exception innerException)
Parameters
Properties
HighWaterToken
Gets the highest fencing token previously observed for the affected scope, when known.
public long? HighWaterToken { get; init; }
Property Value
- long?
PresentedToken
Gets the fencing token that was presented and rejected, when known.
public long? PresentedToken { get; init; }
Property Value
- long?