Class RabbitMqEventBusOptions
- Namespace
- Savvyio.Extensions.RabbitMQ.EventDriven
- Assembly
- Savvyio.Extensions.RabbitMQ.dll
Configuration options for RabbitMqEventBus.
public class RabbitMqEventBusOptions : RabbitMqMessageOptions, IValidatableParameterObject, IParameterObject
- Inheritance
-
RabbitMqEventBusOptions
- Implements
- Derived
- Inherited Members
Examples
Configure a RabbitMqEventBusOptions with the AMQP URL and exchange settings required for RabbitMQ event publishing and subscription.
using System;
using Savvyio.Extensions.RabbitMQ.EventDriven;
namespace ExampleApp;
public class RabbitMqEventSetup
{
public static RabbitMqEventBusOptions CreateOptions()
{
var options = new RabbitMqEventBusOptions
{
AmqpUrl = new Uri("amqp://guest:guest@localhost:5672"),
ExchangeName = "account-events",
Persistent = true
};
return options;
}
}
Constructors
RabbitMqEventBusOptions()
Initializes a new instance of the RabbitMqEventBusOptions class.
public RabbitMqEventBusOptions()
Remarks
The following table shows the initial property values for an instance of RabbitMqEventBusOptions.
| Property | Initial Value |
|---|---|
| ExchangeName | null |
Properties
ExchangeName
Gets or sets the name of the exchange.
public string ExchangeName { get; set; }
Property Value
- string
The name of the exchange.
Methods
ValidateOptions()
Determines whether the public read-write properties of this instance are in a valid state.
public override void ValidateOptions()
Remarks
This method is expected to throw exceptions when one or more conditions fails to be in a valid state.
Exceptions
- InvalidOperationException
ExchangeName cannot be null or empty.