Пример #1
0
        public void Setup()
        {
            var connection = _redisConnectionProvider.Get();
            var messages   = connection.GetDatabase().SetScan(MessageRedisKey, int.MaxValue);

            foreach (var messageData in messages)
            {
                var message = Deserialize((byte[])messageData);
                _inMemoryMessageStore.Add(message);
            }
        }
        public void Setup()
        {
            var connection = _redisConnectionProvider.Get();
            var results    = connection.GetDatabase().SetScan(QueueNameKey);

            foreach (var result in results)
            {
                try
                {
                    var queue = DeserializeIQueue(result);
                    _queues.Add(queue);
                }
                catch
                {
                    _logger.LogError("Failed to deserialize topic data");
                }
            }

            _logger.LogInformation($"Found {results.Count()} topics");
        }