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
messagestringThe 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
messagestringThe error message that explains the reason for the exception.
innerExceptionExceptionThe 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
errorCodestringThe error code to associate with the exception.
messagestringThe 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
errorCodestringThe error code to associate with the exception.
messagestringThe error message that explains the reason for the exception.
innerExceptionExceptionThe 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
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
Methods
BrokerConnectionFailed(string, Exception?)
Creates an exception for when the message broker connection fails.
public static MessagingException BrokerConnectionFailed(string brokerAddress, Exception? innerException = null)
Parameters
brokerAddressstringThe address of the message broker.
innerExceptionExceptionThe 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
messageIdstringThe 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
messageIdstringThe ID of the message that exceeded retry limit.
retryCountintThe 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
messageIdstringThe ID of the message that failed to route.
reasonstringThe reason for the routing failure.
Returns
- MessagingException
A new MessagingException instance.