/// <summary> /// Loads the persisters. /// </summary> /// <returns></returns> private RouterControlConfigurator LoadPersisters() { _subscriptorsPersiter = new NullSubscriptorPersister(); MongoPersiterConfig mongoPersister = _hermEsbConfig.RouterControlProcessor.Persister.MongoPersister; if (mongoPersister.Connection.Servers.Count > 0) { //Cargamos la configuracion de mongo var settings = new MongoSettingsExtended { ConnectionMode = mongoPersister.Connection.ConnectionMode, ConnectTimeout = mongoPersister.Connection.ConnectTimeout, MaxConnectionIdleTime = mongoPersister.Connection.MaxConnectionIdleTime, MaxConnectionLifeTime = mongoPersister.Connection.MaxConnectionLifeTime, MaxConnectionPoolSize = mongoPersister.Connection.MaxConnectionPoolSize, MinConnectionPoolSize = mongoPersister.Connection.MinConnectionPoolSize, ReplicaSetName = mongoPersister.Connection.ReplicaSetName, SlaveOk = mongoPersister.Connection.SlaveOk, SocketTimeout = mongoPersister.Connection.SocketTimeout, WaitQueueSize = mongoPersister.Connection.WaitQueueSize, WaitQueueTimeout = mongoPersister.Connection.WaitQueueTimeout, Database = mongoPersister.Connection.Database }; foreach (ServerConnection server in mongoPersister.Connection.Servers) { settings.AddServer(server.Server, server.Port); } _subscriptorsPersiter = MongoSubscriptorsPersisterFactory.Create(settings, mongoPersister.Collection); } return(this); }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptorsHelper" /> class. /// </summary> /// <param name="subscriptorsRepository">The subscriptors repository.</param> /// <param name="subscriptorsPersister">The subscriptors persiter.</param> public SubscriptorsHelper(ISubscriptorsRepository subscriptorsRepository, ISubscriptorsPersister subscriptorsPersister) { _subscriptorsRepository = subscriptorsRepository; _subscriptorsPersister = subscriptorsPersister; }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptorsHelper" /> class. /// </summary> /// <param name="subscriptorsRepository">The subscriptors repository.</param> /// <param name="subscriptorsPersister">The subscriptors persiter.</param> public SubscriptorsHelper(ISubscriptorsRepository subscriptorsRepository, ISubscriptorsPersister subscriptorsPersister) { _subscriptorsRepository = subscriptorsRepository; _subscriptorsPersister = subscriptorsPersister; }
/// <summary> /// Loads the persisters. /// </summary> /// <returns></returns> private RouterControlConfigurator LoadPersisters() { _subscriptorsPersiter = new NullSubscriptorPersister(); MongoPersiterConfig mongoPersister = _hermEsbConfig.RouterControlProcessor.Persister.MongoPersister; if (mongoPersister.Connection.Servers.Count > 0) { //Cargamos la configuracion de mongo var settings = new MongoSettingsExtended { ConnectionMode = mongoPersister.Connection.ConnectionMode, ConnectTimeout = mongoPersister.Connection.ConnectTimeout, MaxConnectionIdleTime = mongoPersister.Connection.MaxConnectionIdleTime, MaxConnectionLifeTime = mongoPersister.Connection.MaxConnectionLifeTime, MaxConnectionPoolSize = mongoPersister.Connection.MaxConnectionPoolSize, MinConnectionPoolSize = mongoPersister.Connection.MinConnectionPoolSize, ReplicaSetName = mongoPersister.Connection.ReplicaSetName, SlaveOk = mongoPersister.Connection.SlaveOk, SocketTimeout = mongoPersister.Connection.SocketTimeout, WaitQueueSize = mongoPersister.Connection.WaitQueueSize, WaitQueueTimeout = mongoPersister.Connection.WaitQueueTimeout, Database = mongoPersister.Connection.Database }; foreach (ServerConnection server in mongoPersister.Connection.Servers) { settings.AddServer(server.Server, server.Port); } _subscriptorsPersiter = MongoSubscriptorsPersisterFactory.Create(settings, mongoPersister.Collection); } return this; }