C# Класс EasyNetQ.Consumer.DefaultConsumerErrorStrategy

A strategy for dealing with failed messages. When a message consumer thows, HandleConsumerError is invoked. The general priciple is to put all failed messages in a dedicated error queue so that they can be examined and retried (or ignored). Each failed message is wrapped in a special system message, 'Error' and routed by a special exchange named after the orignal message's routing key. This is so that ad-hoc queues can be attached for errors on specific message types. Each exchange is bound to the central EasyNetQ error queue.
Наследование: IConsumerErrorStrategy
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DefaultConsumerErrorStrategy ( IConnectionFactory connectionFactory, ISerializer serializer, IEasyNetQLogger logger, IConventions conventions, ITypeNameSerializer typeNameSerializer, IErrorMessageSerializer errorMessageSerializer ) : System
Dispose ( ) : void
HandleConsumerCancelled ( EasyNetQ.Consumer.ConsumerExecutionContext context ) : AckStrategy
HandleConsumerError ( EasyNetQ.Consumer.ConsumerExecutionContext context, Exception exception ) : AckStrategy

Приватные методы

Метод Описание
Connect ( ) : void
CreateConnectionCheckMessage ( ) : string
CreateErrorMessage ( EasyNetQ.Consumer.ConsumerExecutionContext context, Exception exception ) : byte[]
DeclareDefaultErrorQueue ( IModel model ) : void
DeclareErrorExchangeAndBindToDefaultErrorQueue ( IModel model, EasyNetQ.Consumer.ConsumerExecutionContext context ) : string
DeclareErrorExchangeQueueStructure ( IModel model, EasyNetQ.Consumer.ConsumerExecutionContext context ) : string

Описание методов

DefaultConsumerErrorStrategy() публичный Метод

public DefaultConsumerErrorStrategy ( IConnectionFactory connectionFactory, ISerializer serializer, IEasyNetQLogger logger, IConventions conventions, ITypeNameSerializer typeNameSerializer, IErrorMessageSerializer errorMessageSerializer ) : System
connectionFactory IConnectionFactory
serializer ISerializer
logger IEasyNetQLogger
conventions IConventions
typeNameSerializer ITypeNameSerializer
errorMessageSerializer IErrorMessageSerializer
Результат System

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

HandleConsumerCancelled() публичный Метод

public HandleConsumerCancelled ( EasyNetQ.Consumer.ConsumerExecutionContext context ) : AckStrategy
context EasyNetQ.Consumer.ConsumerExecutionContext
Результат AckStrategy

HandleConsumerError() публичный Метод

public HandleConsumerError ( EasyNetQ.Consumer.ConsumerExecutionContext context, Exception exception ) : AckStrategy
context EasyNetQ.Consumer.ConsumerExecutionContext
exception System.Exception
Результат AckStrategy