DefineQueue() public method

public DefineQueue ( ) : IQueue
return IQueue
Ejemplo n.º 1
0
        public void ShouldVisitTopologyMultipleTimesExclusiveQueue()
        {
            var factory = new DefaultConnectionFactory();
            using (var connection = factory.Create(new Uri("amqp://localhost/integration")))
            {
                var model = connection.CreateModel();

                var topology = new Topology();
                topology.DefineQueue();

                var builder = new TopologyBuilder(model);
                topology.Visit(builder);
                topology.Visit(builder);
            }
        }
Ejemplo n.º 2
0
        public void ShouldVisitExclusiveQueue()
        {
            var factory = new DefaultConnectionFactory();
            using (var connection = factory.Create(new Uri("amqp://localhost/integration")))
            {
                var model = connection.CreateModel();

                var topology = new Topology();
                var q1 = topology.DefineQueue();

                topology.Visit(new TopologyBuilder(model));

                Assert.That(q1.HasName);

                var queues = admin.Queues(IntegrationVHost);
                Assert.That(queues.Any(e => e.Name == q1.Name));
            }
        }
Ejemplo n.º 3
0
        public void ShouldVisitTopologyWithQueueBoundToExchange()
        {
            var factory = new DefaultConnectionFactory();
            using (var connection = factory.Create(new Uri("amqp://localhost/integration")))
            {
                var model = connection.CreateModel();

                var topology = new Topology();
                var e1 = topology.DefineExchange("exchange1", ExchangeType.Topic);
                var q1 = topology.DefineQueue("queue");

                q1.BindTo(e1);

                topology.Visit(new TopologyBuilder(model));

                var exchanges = admin.Exchanges(IntegrationVHost);
                Assert.That(exchanges.Any(e => e.Name == e1.Name));

                var queues = admin.Queues(IntegrationVHost);
                Assert.That(queues.Any(e => e.Name == q1.Name));
            }
        }