コード例 #1
0
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            // Disable SSL certificate validation
            ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

            var url = Environment.GetEnvironmentVariable("ELASTICSEARCH_URL");
            if (string.IsNullOrEmpty(url))
            {
                Assert.Inconclusive("The environment variabel named 'ELASTICSEARCH_URL' isn't set. Set it to e.g. 'http://localhost:9200'");
            }

            _resolver = eventFlowOptions
                .ConfigureElasticsearch(new Uri(url))
                .UseElasticsearchReadModel<ElasticsearchTestAggregateReadModel>()
                .CreateResolver();
            _elasticClient = _resolver.Resolve<IElasticClient>();
            _readModelPopulator = _resolver.Resolve<IReadModelPopulator>();
            _readModelDescriptionProvider = _resolver.Resolve<IReadModelDescriptionProvider>();
            _readModelStore = _resolver.Resolve<IElasticsearchReadModelStore<ElasticsearchTestAggregateReadModel>>();

            return _resolver;
        }
コード例 #2
0
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            // Disable SSL certificate validation
            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };

            var url = Environment.GetEnvironmentVariable("ELASTICSEARCH_URL");

            if (string.IsNullOrEmpty(url))
            {
                Assert.Inconclusive("The environment variabel named 'ELASTICSEARCH_URL' isn't set. Set it to e.g. 'http://localhost:9200'");
            }

            _resolver = eventFlowOptions
                        .ConfigureElasticsearch(new Uri(url))
                        .UseElasticsearchReadModel <ElasticsearchTestAggregateReadModel>()
                        .CreateResolver();
            _elasticClient                = _resolver.Resolve <IElasticClient>();
            _readModelPopulator           = _resolver.Resolve <IReadModelPopulator>();
            _readModelDescriptionProvider = _resolver.Resolve <IReadModelDescriptionProvider>();
            _readModelStore               = _resolver.Resolve <IElasticsearchReadModelStore <ElasticsearchTestAggregateReadModel> >();

            return(_resolver);
        }