Interface IMessageContext
- Namespace
- NuvTools.Notification.Messaging.Interfaces
- Assembly
- NuvTools.Notification.Messaging.dll
Provides operational methods for managing the lifecycle of a received message (e.g., completing, abandoning, dead-lettering).
public interface IMessageContext
Methods
AbandonAsync(CancellationToken)
Abandons the message, making it available for reprocessing by returning it to the queue.
Task AbandonAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe while waiting for the operation to complete.
Returns
- Task
A task representing the asynchronous abandon operation.
CompleteAsync(CancellationToken)
Marks the message as successfully processed and removes it from the queue.
Task CompleteAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to observe while waiting for the operation to complete.
Returns
- Task
A task representing the asynchronous complete operation.
DeadLetterAsync(string, string?, CancellationToken)
Moves the message to the dead-letter queue with a specified reason and optional error description.
Task DeadLetterAsync(string reason, string? errorDescription = null, CancellationToken cancellationToken = default)
Parameters
reasonstringThe reason why the message is being dead-lettered.
errorDescriptionstringOptional detailed description of the error that caused the message to be dead-lettered.
cancellationTokenCancellationTokenA token to observe while waiting for the operation to complete.
Returns
- Task
A task representing the asynchronous dead-letter operation.