Table of Contents

Interface IConsumerBuilder

Namespace
RabbitMQ.AMQP.Client
Assembly
RabbitMQ.AMQP.Client.dll
public interface IConsumerBuilder

Methods

BuildAndStartAsync(CancellationToken)

Task<IConsumer> BuildAndStartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<IConsumer>

DirectReplyTo(bool)

If direct reply-to is enabled, the client will use the direct reply-to feature of AMQP 1.0. The server must also support direct reply-to. This feature allows the server to send the reply directly to the client without going through a reply queue. This can improve performance and reduce latency. Default is false. https://www.rabbitmq.com/docs/direct-reply-to

IConsumerBuilder DirectReplyTo(bool directReplyTo)

Parameters

directReplyTo bool

Returns

IConsumerBuilder

InitialCredits(int)

IConsumerBuilder InitialCredits(int initialCredits)

Parameters

initialCredits int

Returns

IConsumerBuilder

MessageHandler(MessageHandler)

IConsumerBuilder MessageHandler(MessageHandler handler)

Parameters

handler MessageHandler

Returns

IConsumerBuilder

Queue(IQueueSpecification)

IConsumerBuilder Queue(IQueueSpecification queueSpecification)

Parameters

queueSpecification IQueueSpecification

Returns

IConsumerBuilder

Queue(string?)

IConsumerBuilder Queue(string? queueName)

Parameters

queueName string

Returns

IConsumerBuilder

Stream()

IConsumerBuilder.IStreamOptions Stream()

Returns

IConsumerBuilder.IStreamOptions

SubscriptionListener(Action<ListenerContext>)

SubscriptionListener interface callback to add behavior before a subscription is created. This callback is meant for stream consumers: it can be used to dynamically set the offset the consumer attaches to in the stream. It is called when the consumer is first created and when the client has to re-subscribe (e.g. after a disconnection).

IConsumerBuilder SubscriptionListener(Action<IConsumerBuilder.ListenerContext> listenerContext)

Parameters

listenerContext Action<IConsumerBuilder.ListenerContext>

Contains the listenerContext, see IConsumerBuilder.ListenerContext

Returns

IConsumerBuilder

IConsumerBuilderThe consumer builder.