Table of Contents

Class MessagingException

Namespace
Excalibur.Dispatch.Exceptions
Assembly
Excalibur.Dispatch.dll

Exception thrown when messaging-related errors occur.

public sealed class MessagingException : DispatchException, ISerializable
Inheritance
MessagingException
Implements
Inherited Members
Extension Methods

Constructors

MessagingException()

Initializes a new instance of the MessagingException class.

public MessagingException()

MessagingException(string)

Initializes a new instance of the MessagingException class with a specified error message.

public MessagingException(string message)

Parameters

message string

The error message that explains the reason for the exception.

MessagingException(string, Exception)

Initializes a new instance of the MessagingException class with a specified error message and a reference to the inner exception.

public MessagingException(string message, Exception innerException)

Parameters

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception.

MessagingException(string, string)

Initializes a new instance of the MessagingException class with an explicit error code.

public MessagingException(string errorCode, string message)

Parameters

errorCode string

The error code to associate with the exception.

message string

The error message that explains the reason for the exception.

MessagingException(string, string, Exception?)

Initializes a new instance of the MessagingException class with an explicit error code and inner exception.

public MessagingException(string errorCode, string message, Exception? innerException)

Parameters

errorCode string

The error code to associate with the exception.

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception.

Properties

MessageId

Gets or sets the message ID that caused the exception.

public string? MessageId { get; set; }

Property Value

string

The current MessageId value.

MessageType

Gets or sets the message type that caused the exception.

public string? MessageType { get; set; }

Property Value

string

The current MessageType value.

QueueName

Gets or sets the queue or topic name involved in the exception.

public string? QueueName { get; set; }

Property Value

string

The current QueueName value.

Methods

BrokerConnectionFailed(string, Exception?)

Creates an exception for when the message broker connection fails.

public static MessagingException BrokerConnectionFailed(string brokerAddress, Exception? innerException = null)

Parameters

brokerAddress string

The address of the message broker.

innerException Exception

The inner exception with connection details.

Returns

MessagingException

A new MessagingException instance.

DuplicateMessage(string)

Creates an exception for when a duplicate message is detected.

public static MessagingException DuplicateMessage(string messageId)

Parameters

messageId string

The ID of the duplicate message.

Returns

MessagingException

A new MessagingException instance.

RetryLimitExceeded(string, int)

Creates an exception for when the retry limit is exceeded.

public static MessagingException RetryLimitExceeded(string messageId, int retryCount)

Parameters

messageId string

The ID of the message that exceeded retry limit.

retryCount int

The number of retries attempted.

Returns

MessagingException

A new MessagingException instance.

RoutingFailed(string, string)

Creates an exception for when message routing fails.

public static MessagingException RoutingFailed(string messageId, string reason)

Parameters

messageId string

The ID of the message that failed to route.

reason string

The reason for the routing failure.

Returns

MessagingException

A new MessagingException instance.