public IChangeFeedObserver CreateObserver() { if (destinationType == null) { this.logger.LogError("Destination type is not defined"); throw new NotSupportedException("Destination type is not defined"); } if (this.destinationType == DestinationType.EventHub) { EventHubFeedObserver newConsumer = new EventHubFeedObserver(this.eventHubClient, this.loggerFactory); return(newConsumer); } else if (this.destinationType == DestinationType.CosmosDB) { CosmosDbFeedObserver cosmosDbFeedConsumer = new CosmosDbFeedObserver( this.destClient, this.cosmosDbSink, this.loggerFactory); return(cosmosDbFeedConsumer); } else if (this.destinationType == DestinationType.MongoDB) { CosmosDbFeedObserver cosmosDbFeedConsumer = new CosmosDbFeedObserver( this.destDocStoreCollection, insertRetries, this.cosmosDbSink, this.loggerFactory); return(cosmosDbFeedConsumer); } string message = $"Destination type '{this.destinationType}' is not supported."; this.logger.LogError(message); throw new NotSupportedException(message); }
public IChangeFeedObserver CreateObserver() { if (destinationType == null) { Logger.LogError("Destination type is not defined", true); } if (this.destinationType == DestinationType.EventHub) { EventHubFeedObserver newConsumer = new EventHubFeedObserver(this.eventHubClient); return(newConsumer); } else if (this.destinationType == DestinationType.CosmosDB) { CosmosDbFeedObserver cosmosDbFeedConsumer = new CosmosDbFeedObserver( this.destClient, this.cosmosDbSink); return(cosmosDbFeedConsumer); } return(null); }