示例#1
0
        /// <summary>
        /// CookedRabbit RabbitChannelPool factory.
        /// </summary>
        /// <param name="rabbitSeasoning"></param>
        /// <returns><see cref="IRabbitChannelPool"/></returns>
        public static async Task <IRabbitChannelPool> CreateRabbitChannelPoolAsync(RabbitSeasoning rabbitSeasoning)
        {
            RabbitChannelPool rcp = new RabbitChannelPool();
            await rcp.Initialize(rabbitSeasoning);

            return(rcp);
        }
示例#2
0
        public BenchmarkFixture()
        {
            QueueName    = "CookedRabbit.Benchmark.Scaling";
            ExchangeName = string.Empty;

            // Configured for performance.
            var seasoning = new RabbitSeasoning
            {
                ThrottleFastBodyLoops = false,
                ThrowExceptions       = false,
                WriteErrorsToConsole  = false,
                WriteErrorsToILogger  = false,
                BatchBreakOnException = true
            };

            seasoning.PoolSettings.EnableAutoScaling         = true;
            seasoning.PoolSettings.EmptyPoolWaitTime         = 10;
            seasoning.PoolSettings.WriteSleepNoticeToConsole = false;
            seasoning.PoolSettings.ConnectionPoolCount       = 4;
            seasoning.PoolSettings.ChannelPoolCount          = 4;

            var channelPool = new RabbitChannelPool();

            channelPool.Initialize(seasoning).GetAwaiter().GetResult();

            DeliveryService    = new RabbitDeliveryService(seasoning, channelPool);
            TopologyService    = new RabbitTopologyService(seasoning, channelPool);
            MaintenanceService = new RabbitMaintenanceService(seasoning, channelPool);

            TopologyService.QueueDeclareAsync(QueueName).GetAwaiter().GetResult();
            Payloads = CreatePayloadsAsync(MessagesToSend, MessageSize).GetAwaiter().GetResult();
        }
示例#3
0
        /// <summary>
        /// CookedRabbit RabbitChannelPool factory.
        /// </summary>
        /// <param name="rabbitSeasoning"></param>
        /// <returns><see cref="IRabbitChannelPool"/></returns>
        public static async Task <IRabbitChannelPool> CreateRabbitChannelPoolAsync(RabbitSeasoning rabbitSeasoning)
        {
            var rcp = new RabbitChannelPool();
            await rcp.Initialize(rabbitSeasoning).ConfigureAwait(false);

            return(rcp);
        }
示例#4
0
        private async Task Setup(int messagesToSend, int messageSizes)
        {
            QueueName    = "CookedRabbit.Benchmark.Scaling";
            ExchangeName = string.Empty;

            // Configured for performance.
            var seasoning = new RabbitSeasoning
            {
                ThrottleFastBodyLoops = false,
                ThrowExceptions       = false,
                WriteErrorsToConsole  = false,
                WriteErrorsToILogger  = false,
                BatchBreakOnException = true
            };

            seasoning.PoolSettings.EnableAutoScaling         = true;
            seasoning.PoolSettings.EmptyPoolWaitTime         = 10;
            seasoning.PoolSettings.WriteSleepNoticeToConsole = false;
            seasoning.PoolSettings.ConnectionPoolCount       = 4;
            seasoning.PoolSettings.ChannelPoolCount          = 16;

            var channelPool = new RabbitChannelPool();
            await channelPool.Initialize(seasoning);

            _deliveryService    = new RabbitDeliveryService(seasoning, channelPool);
            _topologyService    = new RabbitTopologyService(seasoning, channelPool);
            _maintenanceService = new RabbitMaintenanceService(seasoning, channelPool);

            await _topologyService.QueueDeclareAsync(QueueName);

            Payloads = await CreatePayloadsAsync(messagesToSend, messageSizes);

            FirstRun = false;
        }
        public void Setup()
        {
            // Configured for performance.
            var seasoning = new RabbitSeasoning
            {
                ThrottleFastBodyLoops = false,
                ThrowExceptions       = false,
                WriteErrorsToConsole  = false,
                WriteErrorsToILogger  = false,
            };

            seasoning.PoolSettings.EnableAutoScaling         = true;
            seasoning.PoolSettings.EmptyPoolWaitTime         = 10;
            seasoning.PoolSettings.WriteSleepNoticeToConsole = false;
            seasoning.PoolSettings.ConnectionPoolCount       = 4;
            seasoning.PoolSettings.ChannelPoolCount          = 16;

            var channelPool = new RabbitChannelPool();

            channelPool.Initialize(seasoning).GetAwaiter().GetResult();

            _deliveryService = new RabbitDeliveryService(seasoning, channelPool);
            _topologyService = new RabbitTopologyService(seasoning, channelPool);
        }