First runnable prototype.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user