/// <inheritdoc/> public async Task ExtractAndPopulateQueueAsync(IAsyncCollector <Message> queue) { var lastReadBookmarkEntry = await _configuration.GetLastReadBookmarkId(); var lastReadPage = await _configuration.GetLastReadPage(); var numberOfPagesToProcess = await _configuration.GetNumberOfPagesToProcess(); _logger.LogInformation($"{nameof(ExtractAndPopulateQueueAsync)} - Starting to process contract events, Last read bookmark is [{lastReadBookmarkEntry}] and last read page is [{lastReadPage}] will be processing upto a maximum of [{numberOfPagesToProcess}] pages in this run."); var selfPage = await _fcsFeedReader.ReadSelfPageAsync(); if (selfPage.Entries.Any(e => e.Id == lastReadBookmarkEntry)) { // extract all entries after that. var lastBookmark = selfPage.Entries.Single(e => e.Id == lastReadBookmarkEntry); var newEntries = selfPage.Entries.Skip(selfPage.Entries.IndexOf(lastBookmark) + 1); _logger.LogInformation($"{nameof(ExtractAndPopulateQueueAsync)} - On [Self page] found [{newEntries.Count()}] new contract events to process."); await _queuePopulator.PopulateSessionQueue(queue, newEntries); await _configuration.SetLastReadPage(selfPage.CurrentPageNumber); } else { // Stroy 3. await ReadArchives(queue, lastReadBookmarkEntry, lastReadPage, numberOfPagesToProcess); } }