private async Task InitClientsAsync() { CosmosClientPool.CreateClient(this.cosmosDBSettings.Producer); CosmosClientPool.CreateClient(this.cosmosDBSettings.Lease); //await CosmosExtension.SetupCosmosDBEntitiesAsync(this.cosmosDBSettings.Producer); await CosmosExtension.SetupCosmosDBEntitiesAsync(this.cosmosDBSettings.Lease); Microsoft.Azure.Cosmos.Container leaseContainer = CosmosClientPool.GetCosmosClient(this.cosmosDBSettings.Lease).GetContainer(this.cosmosDBSettings.Lease.Database, this.cosmosDBSettings.Lease.Container); Microsoft.Azure.Cosmos.Container sourceContainer = CosmosClientPool.GetCosmosClient(this.cosmosDBSettings.Producer).GetContainer(this.cosmosDBSettings.Producer.Database, this.cosmosDBSettings.Producer.Container); this.changeFeedProcessor = sourceContainer .GetChangeFeedProcessorBuilder <EventDataModel>("changeFeedBeginning", this.changesHandler) .WithInstanceName("EventprocessingConsole") .WithLeaseContainer(leaseContainer) .WithStartTime(DateTime.MinValue.ToUniversalTime()) .Build(); await this.changeFeedProcessor.StartAsync(); }
public async Task InitClientsAsync() { CosmosClientPool.CreateClient(this.cosmosDBSettings.Consumer); await CosmosExtension.SetupCosmosDBEntitiesAsync(this.cosmosDBSettings.Consumer); }