Exemple #1
0
        public IntegrationFixture_Zero()
        {
            Seasoning = new RabbitSeasoning
            {
                ThrottleFastBodyLoops = false,
                ThrowExceptions       = false
            };

            Seasoning.SerializeSettings.SerializationMethod = SerializationMethod.ZeroFormat;
            Seasoning.FactorySettings.RabbitHostName        = "localhost";
            Seasoning.PoolSettings.EnableAutoScaling        = true;
            Seasoning.PoolSettings.ConnectionName           = "RabbitServiceTest";
            Seasoning.PoolSettings.ConnectionPoolCount      = 1;
            Seasoning.PoolSettings.ChannelPoolCount         = 2;

            var channelPool = new RabbitChannelPool();

            channelPool
            .SetConnectionPoolAsync(Seasoning, new RabbitConnectionPool())
            .GetAwaiter().GetResult();

            RabbitDeliveryService  = new RabbitDeliveryService(Seasoning, channelPool);
            RabbitTopologyService  = new RabbitTopologyService(Seasoning, channelPool);
            RabbitSerializeService = new RabbitSerializeService(Seasoning, channelPool);

            try
            {
                RabbitTopologyService.QueueDeleteAsync(TestQueueName1, false, false).GetAwaiter().GetResult();
                RabbitTopologyService.QueueDeleteAsync(TestQueueName2, false, false).GetAwaiter().GetResult();
                RabbitTopologyService.QueueDeleteAsync(TestQueueName3, false, false).GetAwaiter().GetResult();
                RabbitTopologyService.QueueDeleteAsync(TestQueueName4, false, false).GetAwaiter().GetResult();
                RabbitTopologyService.ExchangeDeleteAsync(TestExchangeName, false).GetAwaiter().GetResult();
            }
            catch { }
        }
Exemple #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // Cleanup
                    try
                    {
                        RabbitTopologyService.QueueDeleteAsync(TestQueueName1, false, false).GetAwaiter().GetResult();
                        RabbitTopologyService.QueueDeleteAsync(TestQueueName2, false, false).GetAwaiter().GetResult();
                        RabbitTopologyService.QueueDeleteAsync(TestQueueName3, false, false).GetAwaiter().GetResult();
                        RabbitTopologyService.QueueDeleteAsync(TestQueueName4, false, false).GetAwaiter().GetResult();
                        RabbitTopologyService.ExchangeDeleteAsync(TestExchangeName, false).GetAwaiter().GetResult();
                    }
                    catch { }

                    RabbitDeliveryService.Dispose(true);
                    RabbitTopologyService.Dispose(true);
                }

                disposedValue = true;
            }
        }