Table of Contents

Interface IDependencyInjector

Namespace
CarrotMQ.Core.MessageProcessing
Assembly
CarrotMQ.Core.dll

Interface used as abstraction between CarrotMQ and your DI framework. It contains methods for the creation of all types, CarrotMQ.RabbitMQ needs to be able to instantiate dynamically.

public interface IDependencyInjector : IAsyncDisposable
Inherited Members

Methods

CreateAsyncScope()

Creates a new scope for dependency resolution.

IDependencyInjector CreateAsyncScope()

Returns

IDependencyInjector

An instance of IDependencyInjector representing the new scope.

Remarks

A new scope is created for each incoming message

CreateHandler<THandler, TMessage, TResponse>()

Creates a handler for processing messages of type TMessage with response type TResponse.

THandler? CreateHandler<THandler, TMessage, TResponse>() where THandler : HandlerBase<TMessage, TResponse> where TMessage : _IMessage<TMessage, TResponse> where TResponse : class

Returns

THandler

An instance of the handler specified by THandler.

Type Parameters

THandler

The type of the handler to be created.

TMessage

The type of the message to be handled.

TResponse

The type of the response produced by the handler.

Remarks

GetCarrotSerializer()

Gets the ICarrotSerializer that is used to serialize and deserialize the payload of a CarrotMQ message.

ICarrotSerializer GetCarrotSerializer()

Returns

ICarrotSerializer

GetMiddlewareProcessor()

IMiddlewareProcessor GetMiddlewareProcessor()

Returns

IMiddlewareProcessor