namespace DigitalData.MessagingService.RabbitMQ
{
///
/// Configuration for RabbitMQ connection
///
public class RabbitMqConfiguration
{
///
/// Configuration section name in appsettings.json
///
public const string SectionName = "RabbitMQ";
///
/// RabbitMQ server hostname
///
public string HostName { get; set; } = "localhost";
///
/// RabbitMQ AMQP port (default: 5672)
///
public int Port { get; set; } = 5672;
///
/// RabbitMQ username
///
public string UserName { get; set; } = "guest";
///
/// RabbitMQ password
///
public string Password { get; set; } = "guest";
///
/// Virtual host (default: /)
///
public string VirtualHost { get; set; } = "/";
///
/// Enable automatic recovery on connection failure
///
public bool AutomaticRecoveryEnabled { get; set; } = true;
///
/// Network recovery interval in seconds
///
public int NetworkRecoveryIntervalSeconds { get; set; } = 10;
///
/// Name of the main queue where outbound email messages are consumed from.
///
public string QueueName { get; set; } = "messaging-service.email.outbox";
///
/// Name of the exchange to which email messages are published.
/// Messages are routed from this exchange to via .
///
public string ExchangeName { get; set; } = "messaging-service.emails";
///
/// Routing key used to bind to .
///
public string RoutingKey { get; set; } = "email.outbox";
///
/// Name of the Dead Letter Queue (DLQ) where messages that could not be processed are routed.
///
public string DlqQueueName { get; set; } = "messaging-service.email.outbox.dlq";
///
/// Name of the Dead Letter Exchange (DLX) that routes rejected or expired messages to .
///
public string DlqExchangeName { get; set; } = "messaging-service.emails.dlq";
///
/// Routing key used to bind to .
///
public string DlqRoutingKey { get; set; } = "email.outbox.dlq";
///
/// Maximum number of email messages processed concurrently by the consumer.
/// Maps directly to RabbitMQ prefetchCount. Recommended: 3–5.
///
public ushort ConsumerConcurrency { get; set; } = 5;
}
}