Show / Hide Table of Contents

Class ConsumerOptions

Options for configuring a message consumer of a queue.

Inheritance
object
ConsumerOptions
Implements
IEquatable<ConsumerOptions>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: CodersRealm.AmqpClient
Assembly: CodersRealm.AmqpClient.dll
Syntax
public record ConsumerOptions : IEquatable<ConsumerOptions>

Constructors

ConsumerOptions(IQueue?, string?, string?, bool, AcknowledgementMode, bool, MessageProcessorAsync?, ErrorHandlerAsync?)

Options for configuring a message consumer of a queue.

Declaration
public ConsumerOptions(IQueue? Queue = null, string? QueueName = null, string? MessageSelector = null, bool NoLocalMessages = false, AcknowledgementMode AcknowledgementMode = AcknowledgementMode.AutoAcknowledge, bool UseConcurrency = false, MessageProcessorAsync? OnMessageReceivedAsync = null, ErrorHandlerAsync? OnErrorAsync = null)
Parameters
Type Name Description
IQueue Queue

The queue instance to consume from. If set, this takes precedence over QueueName.

string QueueName

The name of the queue to consume from when Queue is not provided.

string MessageSelector

A message selector expression used to filter messages delivered to the subscriber. See the underlying messaging provider for supported selector syntax.

bool NoLocalMessages

When true, messages published by the same connection that created the subscriber will not be delivered to it. Defaults to false.

AcknowledgementMode AcknowledgementMode

The acknowledgement mode used by the consumer. Defaults to AutoAcknowledge.

bool UseConcurrency

When true, messages will be processed concurrently. Default is false.

MessageProcessorAsync OnMessageReceivedAsync

Asynchronous handler invoked when a message is received.

ErrorHandlerAsync OnErrorAsync

Asynchronous handler invoked when an error occurs while processing messages.

Properties

AcknowledgementMode

The acknowledgement mode used by the consumer. Defaults to AutoAcknowledge.

Declaration
public AcknowledgementMode AcknowledgementMode { get; init; }
Property Value
Type Description
AcknowledgementMode

MessageSelector

A message selector expression used to filter messages delivered to the subscriber. See the underlying messaging provider for supported selector syntax.

Declaration
public string? MessageSelector { get; init; }
Property Value
Type Description
string

NoLocalMessages

When true, messages published by the same connection that created the subscriber will not be delivered to it. Defaults to false.

Declaration
public bool NoLocalMessages { get; init; }
Property Value
Type Description
bool

OnErrorAsync

Asynchronous handler invoked when an error occurs while processing messages.

Declaration
public ErrorHandlerAsync? OnErrorAsync { get; init; }
Property Value
Type Description
ErrorHandlerAsync

OnMessageReceivedAsync

Asynchronous handler invoked when a message is received.

Declaration
public MessageProcessorAsync? OnMessageReceivedAsync { get; init; }
Property Value
Type Description
MessageProcessorAsync

Queue

The queue instance to consume from. If set, this takes precedence over QueueName.

Declaration
public IQueue? Queue { get; init; }
Property Value
Type Description
IQueue

QueueName

The name of the queue to consume from when Queue is not provided.

Declaration
public string? QueueName { get; init; }
Property Value
Type Description
string

UseConcurrency

When true, messages will be processed concurrently. Default is false.

Declaration
public bool UseConcurrency { get; init; }
Property Value
Type Description
bool

Implements

IEquatable<T>
In this article
Back to top Generated by DocFX