private static void Main() { ServicePointManager.DefaultConnectionLimit = 20; var dashboardConnectionString = ConfigurationManager.AppSettings["AzureWebJobsDashboard"]; var storageConnectionString = ConfigurationManager.AppSettings["AzureWebJobsStorage"]; var svcCollection = new ServiceCollection(); svcCollection.AddSplunkLogging(new SplunkOptions { SplunkHost = ConfigurationManager.AppSettings["SplunkHost"], Token = ConfigurationManager.AppSettings["LRRToken"] }); svcCollection.AddScoped <ILoanRequestRepository, MockLoanRequestRepository>(); svcCollection.AddScoped <IPipe <IReadOnlyCollection <LoanRequest> >, QueueBackedSubmittedLoanRequestsPipe>(); svcCollection.AddSingleton(_ => SimpleQueueHelperFactory.Create("submitted-loan-requests", storageConnectionString)); svcCollection.AddTransient <Functions>(); var config = new JobHostConfiguration(); config.NameResolver = new TriggerExpressionResolver(); config.DashboardConnectionString = dashboardConnectionString; config.StorageConnectionString = storageConnectionString; config.JobActivator = new MyActivator(svcCollection.BuildServiceProvider()); config.UseTimers(); if (config.IsDevelopment) { config.UseDevelopmentSettings(); } var host = new JobHost(config); host.RunAndBlock(); }
private static void Main() { var dashboardConnectionString = ConfigurationManager.AppSettings["AzureWebJobsDashboard"]; var storageConnectionString = ConfigurationManager.AppSettings["AzureWebJobsStorage"]; var svcCollection = new ServiceCollection(); svcCollection.AddScoped <IHttpMessageHandlerFactory, MockHttpMessageHandlerFactory>(); svcCollection.AddScoped <ICreditCheckFilter, CreditCheckFilter>(); svcCollection.AddScoped <IPipe <EnrichedLoanRequest>, QueueBackedLoanQuoteSubmissionPipe>(); svcCollection.AddSingleton(_ => SimpleQueueHelperFactory.Create("credit-checked-loan-requests", storageConnectionString)); svcCollection.AddSplunkLogging(new SplunkOptions { SplunkHost = ConfigurationManager.AppSettings["SplunkHost"], Token = ConfigurationManager.AppSettings["CCToken"] }); svcCollection.AddTransient <Functions>(); var config = new JobHostConfiguration(); config.DashboardConnectionString = dashboardConnectionString; config.StorageConnectionString = storageConnectionString; config.JobActivator = new MyActivator(svcCollection.BuildServiceProvider()); var host = new JobHost(config); host.RunAndBlock(); }
private static void Main() { var dashboardConnectionString = ConfigurationManager.AppSettings["AzureWebJobsDashboard"]; var storageConnectionString = ConfigurationManager.AppSettings["AzureWebJobsStorage"]; var svcCollection = new ServiceCollection(); svcCollection.AddSplunkLogging(new SplunkOptions { SplunkHost = ConfigurationManager.AppSettings["SplunkHost"], Token = ConfigurationManager.AppSettings["LRSToken"] }); svcCollection.AddScoped <IHttpMessageHandlerFactory, MockHttpMessageHandlerFactory>(); svcCollection.AddScoped <ILoanRequestSenderFilter, LoanRequestSenderFilter>(); svcCollection.AddScoped <IPipe <LoanQuoteResponse>, AggregatedLoanQuotesPipe>(); svcCollection.AddScoped <IResiliencePolicy, DefaultResiliencePolicy>(); svcCollection.AddSingleton(_ => SimpleQueueHelperFactory.Create("aggregated-loan-quotes", storageConnectionString)); svcCollection.AddTransient <Functions>(); var config = new JobHostConfiguration(); config.DashboardConnectionString = dashboardConnectionString; config.StorageConnectionString = storageConnectionString; config.JobActivator = new MyActivator(svcCollection.BuildServiceProvider()); var host = new JobHost(config); host.RunAndBlock(); }