First runnable prototype.

This commit is contained in:
2025-07-05 18:02:25 +02:00
parent cc00c4da08
commit 908774c5aa
10 changed files with 385 additions and 219 deletions

View File

@ -24,6 +24,10 @@ namespace MessengerBroker.Configuration.Model
public SlaveServer[] SlaveServers { get; set; }
public bool HousekeepingEnabled { get; set; }
public int HousekeepingMessageAgeInMinutes { get; set; }
public BrokerConfiguration(
PersistenceConfiguration apiPersistenceConfiguration,
PersistenceConfiguration broPersistenceConfiguration,
@ -37,15 +41,22 @@ namespace MessengerBroker.Configuration.Model
this.MasterServers = masters;
this.SlaveServers = slaves;
this.Proxies = [];
this.HousekeepingEnabled = true;
this.HousekeepingMessageAgeInMinutes = 180;
}
public BrokerConfiguration(IEnvironmentConfigurationSource config):this(
public BrokerConfiguration(IEnvironmentConfigurationSource config) : this(
ApiEnvironmentPersistenceConfigurationParser.Parse(config),
EnvironmentPersistenceConfigurationParser.Parse(config),
config.GetValue<Guid>(Constants.EnvironmentVariables.BROKER_ID),
MasterServerParser.Parse(config.GetValue<string>(Constants.EnvironmentVariables.MASTER_SERVERS)),
SlaveServerParser.Parse(config.GetValue<string>(Constants.EnvironmentVariables.SLAVE_SERVERS)))
{
if(config.HasKey(Constants.EnvironmentVariables.HOUSEKEEPING_ENABLED))
{
this.HousekeepingEnabled = config.GetValue<bool>(Constants.EnvironmentVariables.HOUSEKEEPING_ENABLED);
this.HousekeepingMessageAgeInMinutes = config.GetValue<int>(Constants.EnvironmentVariables.HOUSEKEEPING_MESSAGE_AGE_IN_MINUTES);
}
}
}
}