Beispiel #1
0
        public void Save()
        {
            Config.ConnectionStrings.ConnectionStrings.Set("NServiceBus/Transport", details.ConnectionString);
            var settings = Config.AppSettings.Settings;
            var version  = details.Version;

            settings.Set(SettingsList.VirtualDirectory, details.VirtualDirectory);
            settings.Set(SettingsList.Port, details.Port.ToString());
            settings.Set(SettingsList.HostName, details.HostName);
            settings.Set(SettingsList.LogPath, details.LogPath);
            settings.Set(SettingsList.DBPath, details.DBPath);
            settings.Set(SettingsList.ForwardAuditMessages, details.ForwardAuditMessages.ToString());
            settings.Set(SettingsList.ForwardErrorMessages, details.ForwardErrorMessages.ToString(), version);
            settings.Set(SettingsList.TransportType, V5Transports.FindByName(details.TransportPackage).TypeName, version);
            settings.Set(SettingsList.AuditQueue, details.AuditQueue);
            settings.Set(SettingsList.ErrorQueue, details.ErrorQueue);
            settings.Set(SettingsList.ErrorLogQueue, details.ErrorLogQueue);
            settings.Set(SettingsList.AuditLogQueue, details.AuditLogQueue);
            settings.Set(SettingsList.AuditRetentionPeriod, details.AuditRetentionPeriod.ToString(), version);
            settings.Set(SettingsList.ErrorRetentionPeriod, details.ErrorRetentionPeriod.ToString(), version);

            // Add Settings for performance tuning
            // See https://github.com/Particular/ServiceControl/issues/655
            if (!settings.AllKeys.Contains("Raven/Esent/MaxVerPages"))
            {
                settings.Add("Raven/Esent/MaxVerPages", "2048");
            }
            UpdateRuntimeSection();

            Config.Save();
        }
Beispiel #2
0
 public void Validate()
 {
     if (V5Transports.FindByName(details.TransportPackage) == null)
     {
         throw new Exception($"Invalid Transport - Must be one of: {string.Join(",", V5Transports.All.Select(p => p.Name))}");
     }
 }