Example #1
0
        public async Task <IChangeFeedProcessor> RunCosmosDBSink(
            DocumentCollectionInfo monitorDocumentCollectionInfo,
            DocumentCollectionInfo leaseDocumentCollectionInfo)
        {
            string hostName = Guid.NewGuid().ToString();

            this.logger.LogInformation("Cosmos DB Sink Host name {0}", hostName);

            // destination collection info
            DocumentCollectionInfo destCollInfo = new DocumentCollectionInfo
            {
                Uri            = new Uri(destinationCollection.AccountEndPoint),
                MasterKey      = destinationCollection.Key,
                DatabaseName   = destinationCollection.DbName,
                CollectionName = destinationCollection.CollectionName
            };

            DocumentClient destClient = new DocumentClient(destCollInfo.Uri, destCollInfo.MasterKey);

            ChangeFeedObserverFactory docConsumerFactory = new ChangeFeedObserverFactory(
                destClientExtension,
                cosmosDbSink,
                this.loggerFactory);

            return(await GetChangeFeedProcessor(
                       docConsumerFactory,
                       hostName,
                       monitorDocumentCollectionInfo,
                       leaseDocumentCollectionInfo));
        }
Example #2
0
        public PartitionSupervisorFactoryCore(
            ChangeFeedObserverFactory <T> observerFactory,
            DocumentServiceLeaseManager leaseManager,
            FeedProcessorFactory <T> partitionProcessorFactory,
            ChangeFeedLeaseOptions options)
        {
            if (observerFactory == null)
            {
                throw new ArgumentNullException(nameof(observerFactory));
            }
            if (leaseManager == null)
            {
                throw new ArgumentNullException(nameof(leaseManager));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (partitionProcessorFactory == null)
            {
                throw new ArgumentNullException(nameof(partitionProcessorFactory));
            }

            this.observerFactory           = observerFactory;
            this.leaseManager              = leaseManager;
            this.changeFeedLeaseOptions    = options;
            this.partitionProcessorFactory = partitionProcessorFactory;
        }
Example #3
0
        public async Task <IChangeFeedProcessor> RunEventHubSink(
            DocumentCollectionInfo monitorDocumentCollectionInfo,
            DocumentCollectionInfo leaseDocumentCollectionInfo)
        {
            string hostName = Guid.NewGuid().ToString();

            this.logger.LogInformation("Event Hub Sink Host name {0}", hostName);
            ChangeFeedObserverFactory docConsumerFactory = new ChangeFeedObserverFactory(null, this.loggerFactory);

            return(await GetChangeFeedProcessor(
                       docConsumerFactory,
                       hostName,
                       monitorDocumentCollectionInfo,
                       leaseDocumentCollectionInfo));
        }
Example #4
0
        public async Task <IChangeFeedProcessor> RunEventHubSink(
            DocumentCollectionInfo monitorDocumentCollectionInfo,
            DocumentCollectionInfo leaseDocumentCollectionInfo)
        {
            string hostName = Guid.NewGuid().ToString();

            Trace.TraceInformation("Event Hub Sink Host name {0}", hostName);
            var client = EventHubClient.CreateFromConnectionString(ConfigurationManager.AppSettings["destEhConnStr"]);

            ChangeFeedObserverFactory docConsumerFactory = new ChangeFeedObserverFactory(client);

            return(await GetChangeFeedProcessor(
                       docConsumerFactory,
                       hostName,
                       monitorDocumentCollectionInfo,
                       leaseDocumentCollectionInfo));
        }
Example #5
0
        public async Task <IChangeFeedProcessor> RunMongoDBSink(
            DocumentCollectionInfo monitorDocumentCollectionInfo,
            DocumentCollectionInfo leaseDocumentCollectionInfo)
        {
            string hostName = Guid.NewGuid().ToString();

            this.logger.LogInformation("Mongo DB Sink Host name {0}", hostName);

            ChangeFeedObserverFactory docConsumerFactory = new ChangeFeedObserverFactory(
                destDocStoreCollection,
                insertRetries,
                cosmosDbSink,
                this.loggerFactory);

            return(await GetChangeFeedProcessor(
                       docConsumerFactory,
                       hostName,
                       monitorDocumentCollectionInfo,
                       leaseDocumentCollectionInfo));
        }