Class SubscriberExceptionReceiver
inherit this class and override it's methods in order to receive event subscriber exceptions.
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.Messaging.Remote.dll
Syntax
public abstract class SubscriberExceptionReceiver
Methods
OnEventReceiveError<TEvent>(string, int, Exception, CancellationToken)
this method is triggered when there's an error reading the next event message from the underlying gRPC stream. you'd hardly ever be overriding this method since it's none of your business most of the time and the operation would be automatically retried until successful.
Declaration
public virtual Task OnEventReceiveError<TEvent>(string subscriberID, int attemptCount, Exception exception, CancellationToken ct) where TEvent : class, IEvent
Parameters
Type | Name | Description |
---|---|---|
string | subscriberID | the unique ID of the subscriber |
int | attemptCount | the number unsuccessful attempts to read the event message |
Exception | exception | the actual exception that was thrown by the operation |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |
OnGetNextEventRecordError<TEvent>(string, int, Exception, CancellationToken)
this method is triggered when the storage provider has trouble retrieving the next event record.
Declaration
public virtual Task OnGetNextEventRecordError<TEvent>(string subscriberID, int attemptCount, Exception exception, CancellationToken ct) where TEvent : class, IEvent
Parameters
Type | Name | Description |
---|---|---|
string | subscriberID | the unique ID of the subscriber |
int | attemptCount | the number of times the record was attempted to be retrieved |
Exception | exception | the actual exception that was thrown by the operation |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |
OnHandlerExecutionError<TEvent, THandler>(IEventStorageRecord, int, Exception, CancellationToken)
this method is triggered when the event handler has trouble executing the HandleAsync(TEvent, CancellationToken) method.
Declaration
public virtual Task OnHandlerExecutionError<TEvent, THandler>(IEventStorageRecord record, int attemptCount, Exception exception, CancellationToken ct) where TEvent : class, IEvent where THandler : IEventHandler<TEvent>
Parameters
Type | Name | Description |
---|---|---|
IEventStorageRecord | record | the event storage record that was supposed to be executed |
int | attemptCount | the number of times the record was attempted to be executed |
Exception | exception | the actual exception that was thrown by the operation |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |
THandler | the type of the event handler that failed to execute |
OnMarkEventAsCompleteError<TEvent>(IEventStorageRecord, int, Exception, CancellationToken)
this method is triggered when the storage provider has trouble marking an event record as complete.
Declaration
public virtual Task OnMarkEventAsCompleteError<TEvent>(IEventStorageRecord record, int attemptCount, Exception exception, CancellationToken ct) where TEvent : class, IEvent
Parameters
Type | Name | Description |
---|---|---|
IEventStorageRecord | record | the event storage record that was supposed to be marked complete |
int | attemptCount | the number of times the record was attempted to be marked complete |
Exception | exception | the actual exception that was thrown by the operation |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |
OnStoreEventRecordError<TEvent>(IEventStorageRecord, int, Exception, CancellationToken)
this method is triggered when the storage provider has trouble persisting an event record.
Declaration
public virtual Task OnStoreEventRecordError<TEvent>(IEventStorageRecord record, int attemptCount, Exception exception, CancellationToken ct) where TEvent : class, IEvent
Parameters
Type | Name | Description |
---|---|---|
IEventStorageRecord | record | the event storage record that was supposed to be persisted |
int | attemptCount | the number of times the record was attempted to be persisted |
Exception | exception | the actual exception that was thrown by the operation |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |