Table of Contents

Class RabbitMqMessageOptions

Namespace
Savvyio.Extensions.RabbitMQ
Assembly
Savvyio.Extensions.RabbitMQ.dll

Configuration options that is related to RabbitMQ.

public class RabbitMqMessageOptions : IValidatableParameterObject, IParameterObject
Inheritance
RabbitMqMessageOptions
Implements
Derived

Constructors

RabbitMqMessageOptions()

Initializes a new instance of the RabbitMqMessageOptions class with default values.

public RabbitMqMessageOptions()

Remarks

The following table shows the initial property values for an instance of RabbitMqMessageOptions.

PropertyInitial Value
AmqpUrlnew Uri("amqp://localhost:5672")
Persistentfalse

Properties

AmqpUrl

Gets or sets the AMQP URL used to connect to the RabbitMQ broker.

public Uri AmqpUrl { get; set; }

Property Value

Uri

The Uri representing the AMQP endpoint for the RabbitMQ broker.

Persistent

Gets or sets a value indicating whether messages should be published as persistent.

public bool Persistent { get; set; }

Property Value

bool

true if messages are marked as persistent and survive broker restarts; otherwise, false.

Remarks

When set to true, messages are stored to disk by RabbitMQ, ensuring delivery even if the broker restarts. This corresponds to setting the delivery mode to persistent (2) in RabbitMQ.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public virtual void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

InvalidOperationException

AmqpUrl cannot be null.

See Also