Table of Contents

Class MessagingOptions

Namespace
Integrations.Infrastructure.Messaging
Assembly
Integrations.Infrastructure.dll

RabbitMQ settings (section Messaging).

public sealed class MessagingOptions
Inheritance
MessagingOptions
Inherited Members

Fields

DefaultRetryLaterDelays

Redelivery waits used when RetryLaterDelays is not configured: 1 m, 5 m, 15 m, 1 h, 4 h.

public static readonly IReadOnlyList<TimeSpan> DefaultRetryLaterDelays

Field Value

IReadOnlyList<TimeSpan>

Section

Configuration section name.

public const string Section = "Messaging"

Field Value

string

Properties

ConcurrentMessageLimit

Messages each consumer endpoint handles at once (and prefetches). Each holds a database transaction.

public int ConcurrentMessageLimit { get; set; }

Property Value

int

EffectiveRetryLaterDelays

The redelivery waits in effect.

public IReadOnlyList<TimeSpan> EffectiveRetryLaterDelays { get; }

Property Value

IReadOnlyList<TimeSpan>

Host

Broker host.

public string Host { get; set; }

Property Value

string

IsInMemory

Whether the in-memory transport is selected.

public bool IsInMemory { get; }

Property Value

bool

Password

Broker password (from a secret outside development).

public string Password { get; set; }

Property Value

string

Port

Broker port: 5672, or 5671 with UseSsl.

public ushort Port { get; set; }

Property Value

ushort

Publishers

Who may publish the messages this service consumes, keyed by broker user, with the entities each may act on. Empty (default): every message is trusted for every entity. Once set, a message's publisher is the AMQP user_id property (which RabbitMQ checks against the connection's user), and a message from an unlisted publisher, or for an entity its publisher is not allowed, goes to the _error queue.

public Dictionary<string, PublisherOptions> Publishers { get; set; }

Property Value

Dictionary<string, PublisherOptions>

QueuePrefix

Optional prefix for this service's queue names. It does not isolate environments (see VirtualHost); it only keeps queue names apart when two copies of the service share a virtual host on purpose.

public string? QueuePrefix { get; set; }

Property Value

string

RedeliveryInterval

How often deferred messages that are due are sent back to their queue.

public TimeSpan RedeliveryInterval { get; set; }

Property Value

TimeSpan

RetryLaterDelays

Waits before redelivering a message that cannot be handled yet (its original document has not arrived or is not committed, a concurrent update, the tax provider is down). After the last one the message goes to the _error queue. Empty means DefaultRetryLaterDelays. (Empty by default because the configuration binder appends to an array's initial items instead of replacing them.)

public TimeSpan[] RetryLaterDelays { get; set; }

Property Value

TimeSpan[]

Transport

RabbitMq (default) or InMemory (local runs and tests only; refused in Production).

public string Transport { get; set; }

Property Value

string

UseSsl

Connect over TLS (AMQPS). Required outside Development and Testing.

public bool UseSsl { get; set; }

Property Value

bool

Username

Broker user. One user per service, with permissions limited to its own exchanges and queues.

public string Username { get; set; }

Property Value

string

VirtualHost

Broker virtual host. Use one per environment: exchanges are named after the message types and shared by every queue in a virtual host, so environments that share one also share each other's events.

public string VirtualHost { get; set; }

Property Value

string