コード例 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // "https://payday-calculation-engine.apps.cac.preview.pcf.manulife.com/api/calculationengine/"
            KafkaConfigSettings kafkaConfigSettings = KafkaConfigureServices.InitializeKafka(services, Configuration);

            services.AddSingleton <IHostedService, PayDayConnector>();

            services.AddDiscoveryClient(Configuration);
            services.AddSingleton <DiscoveryHttpMessageHandler>();

            services.AddHttpClient("payday-calc-engine", c =>
            {
                c.BaseAddress = new Uri(kafkaConfigSettings.CalculationEngineEndpoint);
            })
            .AddHttpMessageHandler <DiscoveryHttpMessageHandler>()
            .AddTypedClient <IMessageHandler <ICalculationEngineService>, CalculationEngineService>();

            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Kafka Listener Manager", Version = "v1"
                });
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            KafkaConfigSettings kafkaConfigSettings = KafkaConfigureServices.InitializeKafka(services, Configuration);

            services.AddSingleton <IHostedService, PayDayConnector>();
            services.AddSingleton <IRPSDBProcessManager, RPSDBProcessManager>();
            services.AddSingleton <IMessageHandler <IOutputManager>, OutputManager>();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Generate Output", Version = "v1"
                });
            });
        }
コード例 #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            KafkaConfigSettings kafkaConfigSettings = KafkaConfigureServices.InitializeKafka(services, Configuration);

            services.AddSingleton <ICalculationEngineService, CalculationEngineService>();
            services.AddSingleton <IMessagePublisher, MessagePublisher>();
            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Calculation Engine", Version = "v1"
                });
            });

            services.AddDiscoveryClient(Configuration);
        }
コード例 #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            KafkaConfigSettings kafkaConfigSettings = KafkaConfigureServices.InitializeKafka(services, Configuration);

            services.AddSingleton <IAggregationManager, AggregationManager>();
            services.AddSingleton <IMessageHandler <IMetaManager>, MetaManager>();
            services.AddSingleton <IMessageHandler <IAllocationManager>, AllocationManager>();
            //PayDayConnector as Hosted Service that runs when the app is started.
            services.AddSingleton <IHostedService, PayDayConnector>();
            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Aggregator API", Version = "v1"
                });
            });
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
コード例 #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            KafkaConfigSettings kafkaConfigSettings = KafkaConfigureServices.InitializeKafka(services, Configuration);

            services.AddSingleton <IFileProcessorService, FileProcessorService>();
            services.AddSingleton <IFileManager, FileManager>();
            services.AddSingleton <IMessageManager, MessageManager>();
            services.AddSingleton <IMessagePublisher, MessagePublisher>();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            // Register the Swagger generator, defining 1 or more Swagger documents
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "File Processor", Version = "v1"
                });
            });
        }