Exemplo n.º 1
0
        /// <summary>
        /// Initialization of EventHub receiver is performed at adapter reciever initialization, but if it fails,
        ///  it will be retried when messages are requested
        /// </summary>
        /// <returns></returns>
        private async Task Initialize()
        {
            var watch = Stopwatch.StartNew();

            try
            {
                checkpointer = await checkpointerFactory(settings.Partition);

                cache          = cacheFactory(settings.Partition, checkpointer, baseLogger);
                flowController = new AggregatedQueueFlowController(MaxMessagesPerRead)
                {
                    cache, LoadShedQueueFlowController.CreateAsPercentOfLoadSheddingLimit(getNodeConfig)
                };
                string offset = await checkpointer.Load();

                receiver = await this.eventHubReceiverFactory(settings, offset, logger);

                watch.Stop();
                monitor?.TrackInitialization(true, watch.Elapsed, null);
            }
            catch (Exception ex)
            {
                watch.Stop();
                monitor?.TrackInitialization(false, watch.Elapsed, ex);
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task Initialize(TimeSpan timeout)
        {
            checkpointer = await checkpointerFactory(config.Partition);

            cache = cacheFactory(checkpointer);
            string offset = await checkpointer.Load();

            receiver = await CreateReceiver(config, offset);
        }
Exemplo n.º 3
0
        public async Task Initialize(TimeSpan timeout)
        {
            checkpointer = await checkpointerFactory(config.Partition);

            cache          = cacheFactory(checkpointer);
            flowController = new AggregatedQueueFlowController(MaxMessagesPerRead)
            {
                cache
            };
            string offset = await checkpointer.Load();

            receiver = await CreateReceiver(config, offset);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialization of EventHub receiver is performed at adapter reciever initialization, but if it fails,
        ///  it will be retried when messages are requested
        /// </summary>
        /// <returns></returns>
        private async Task Initialize()
        {
            checkpointer = await checkpointerFactory(settings.Partition);

            cache          = cacheFactory(settings.Partition, checkpointer, baseLogger);
            flowController = new AggregatedQueueFlowController(MaxMessagesPerRead)
            {
                cache
            };
            string offset = await checkpointer.Load();

            receiver = await CreateReceiver(settings, offset, logger);
        }
Exemplo n.º 5
0
        public async Task Initialize(TimeSpan timeout)
        {
            logger.Info("Initializing EventHub partition {0}-{1}.", config.Hub.Path, config.Partition);

            checkpointer = await checkpointerFactory(config.Partition);

            cache          = cacheFactory(config.Partition, checkpointer, baseLogger);
            flowController = new AggregatedQueueFlowController(MaxMessagesPerRead)
            {
                cache
            };
            string offset = await checkpointer.Load();

            receiver = await CreateReceiver(config, offset, logger);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initialization of EventHub receiver is performed at adapter reciever initialization, but if it fails,
        ///  it will be retried when messages are requested
        /// </summary>
        /// <returns></returns>
        private async Task Initialize()
        {
            try
            {
                checkpointer = await checkpointerFactory(settings.Partition);

                cache          = cacheFactory(settings.Partition, checkpointer, baseLogger);
                flowController = new AggregatedQueueFlowController(MaxMessagesPerRead)
                {
                    cache, LoadShedQueueFlowController.CreateAsPercentOfLoadSheddingLimit()
                };
                string offset = await checkpointer.Load();

                receiver = await CreateReceiver(settings, offset, logger);

                monitor.TrackInitialization(true);
            }
            catch (Exception)
            {
                monitor.TrackInitialization(false);
                throw;
            }
        }