Ejemplo n.º 1
0
        public PersistentSubscriptionsManager CreatePersistentSubscriptionsManager()
        {
            var manager = new PersistentSubscriptionsManager(new EventStoreLogger(_logger), GetHttpIpEndpoint(),
                                                             TimeSpan.FromSeconds(5));

            return(manager);
        }
        public Manager(Configuration configuration)
        {
            this.Configuration = configuration;
            var settings =
                ConnectionSettings.Create()
                .KeepReconnecting()
                .KeepRetrying();
            var httpEndPoint = new DnsEndPoint(configuration.Server.Host, configuration.Server.HttpPort);

            Admin    = new UserCredentials(Configuration.Admin.Name, configuration.Admin.Password);
            Operator = new UserCredentials(Configuration.Operator.Name, configuration.Operator.Password);

            Connection = EventStoreConnection.Create(
                settings
                ,
                new UriBuilder(
                    "tcp",
                    configuration.Server.Host,
                    configuration.Server.TcpPort)
                .Uri
                );
            ProjectionsManager = new ProjectionsManager(
                Connection.Settings.Log,
                httpEndPoint,
                Connection.Settings.OperationTimeout
                );
            PersistentSubscriptionsManager = new PersistentSubscriptionsManager(
                Connection.Settings.Log,
                httpEndPoint,
                Connection.Settings.OperationTimeout
                );
        }