public void Configure(IApplicationBuilder app, IHostingEnvironment env, BasketsDbContext basketsDbContext, IBrokerEndpointsConfigurationBuilder endpoints) { ConfigureRequestPipeline(app); basketsDbContext.Database.Migrate(); var brokerBasePath = _configuration["Broker:Path"]; endpoints .AddOutbound <IIntegrationEvent>(FileSystemEndpoint.Create("basket-events", brokerBasePath)) .AddInbound(FileSystemEndpoint.Create("catalog-events", brokerBasePath)) .Connect(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, CatalogDbContext catalogDbContext, IBrokerEndpointsConfigurationBuilder endpoints, JobScheduler jobScheduler) { ConfigureRequestPipeline(app); catalogDbContext.Database.Migrate(); endpoints .AddOutbound <IIntegrationEvent>( FileSystemEndpoint.Create("catalog-events", _configuration["Broker:Path"])) .Connect(); jobScheduler.AddJob("outbound-queue-worker", TimeSpan.FromMilliseconds(100), s => s.GetRequiredService <OutboundQueueWorker>().ProcessQueue()); // Configure outbound worker }