Class OpenSearchDeadLetterHandler
- Namespace
- Excalibur.Data.OpenSearch
- Assembly
- Excalibur.Data.OpenSearch.dll
Handles dead letter messages for OpenSearch operations.
public sealed class OpenSearchDeadLetterHandler
- Inheritance
-
OpenSearchDeadLetterHandler
- Inherited Members
Remarks
Initializes a new instance of the OpenSearchDeadLetterHandler class.
Constructors
OpenSearchDeadLetterHandler(OpenSearchClient, IOptions<OpenSearchDeadLetterOptions>, ILogger<OpenSearchDeadLetterHandler>)
Handles dead letter messages for OpenSearch operations.
public OpenSearchDeadLetterHandler(OpenSearchClient client, IOptions<OpenSearchDeadLetterOptions> options, ILogger<OpenSearchDeadLetterHandler> logger)
Parameters
clientOpenSearchClientThe OpenSearch client.
optionsIOptions<OpenSearchDeadLetterOptions>Dead letter handler options.
loggerILogger<OpenSearchDeadLetterHandler>Logger instance.
Remarks
Initializes a new instance of the OpenSearchDeadLetterHandler class.
Methods
HandleDeadLetterAsync<T>(T, Exception, CancellationToken)
Handles a dead letter document.
public Task HandleDeadLetterAsync<T>(T document, Exception error, CancellationToken cancellationToken) where T : class
Parameters
documentTThe document to handle.
errorExceptionThe error that caused the dead letter.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the asynchronous operation.
Type Parameters
TThe document type.
Exceptions
- InvalidOperationException
Thrown when the dead letter document cannot be stored.
RetryDeadLettersAsync(string, int, CancellationToken)
Retries processing of dead letter documents.
public Task<int> RetryDeadLettersAsync(string indexName, int maxRetries, CancellationToken cancellationToken)
Parameters
indexNamestringThe dead letter index to retry from.
maxRetriesintMaximum number of documents to retry.
cancellationTokenCancellationTokenCancellation token.