Table of Contents

Class OutOfOrderMessageException

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Thrown by the ordering-validation middleware when a received message carries an ordering sequence that is not strictly greater than the last sequence already processed for the same ordering key — i.e. an out-of-order or duplicate delivery.

public sealed class OutOfOrderMessageException : Exception, ISerializable, IFailClosedException
Inheritance
OutOfOrderMessageException
Implements
Inherited Members
Extension Methods

Remarks

Ordering validation is opt-in, and enforces on messages that entered a receive path where ordering applies — recorded by MarkOrderingEnforced(IMessageContext), which the stamping seam calls. For such a message it fails closed in both directions: a sequence that would violate per-key ordering is rejected, and so is a MISSING sequence, since the transport was expected to supply one. A message outside that scope is not checked at all. A rejection is raised by throwing this exception rather than being processed out of order. Consumers that opt into ordering can catch this to divert the message (e.g. to a re-sequencing buffer or dead-letter path).

Constructors

OutOfOrderMessageException()

Initializes a new instance of the OutOfOrderMessageException class.

public OutOfOrderMessageException()

OutOfOrderMessageException(string)

Initializes a new instance of the OutOfOrderMessageException class with a specified message.

public OutOfOrderMessageException(string message)

Parameters

message string

The message that describes the error.

OutOfOrderMessageException(string, Exception)

Initializes a new instance of the OutOfOrderMessageException class with a specified message and inner exception.

public OutOfOrderMessageException(string message, Exception innerException)

Parameters

message string

The message that describes the error.

innerException Exception

The exception that caused this exception.

OutOfOrderMessageException(string, long, long)

Initializes a new instance of the OutOfOrderMessageException class.

public OutOfOrderMessageException(string orderingKey, long receivedSequence, long lastProcessedSequence)

Parameters

orderingKey string

The ordering key (partition/stream) the sequence violation occurred on.

receivedSequence long

The sequence carried by the rejected message.

lastProcessedSequence long

The last sequence already processed for the ordering key.

Properties

LastProcessedSequence

Gets the last sequence already processed for the ordering key.

public long LastProcessedSequence { get; }

Property Value

long

OrderingKey

Gets the ordering key (partition/stream) the sequence violation occurred on.

public string OrderingKey { get; }

Property Value

string

ReceivedSequence

Gets the sequence carried by the rejected message.

public long ReceivedSequence { get; }

Property Value

long