/// <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; } }
public async Task Initialize(TimeSpan timeout) { checkpointer = await checkpointerFactory(config.Partition); cache = cacheFactory(checkpointer); string offset = await checkpointer.Load(); receiver = await CreateReceiver(config, offset); }
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); }
/// <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); }
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); }
/// <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; } }