Пример #1
0
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var topologyBuilder = new ReceiveEndpointBrokerTopologyBuilder();

            if (settings.QueueName.Equals(RabbitMqExchangeNames.ReplyTo, StringComparison.OrdinalIgnoreCase))
            {
                return(topologyBuilder.BuildBrokerTopology());
            }

            var queueArguments = new Dictionary <string, object>(settings.QueueArguments);

            var queueAutoDelete = settings.AutoDelete;

            if (settings.QueueExpiration.HasValue)
            {
                queueArguments["x-expires"] = (long)settings.QueueExpiration.Value.TotalMilliseconds;
                queueAutoDelete             = false;
            }

            topologyBuilder.Exchange = topologyBuilder.ExchangeDeclare(settings.ExchangeName ?? settings.QueueName, settings.ExchangeType, settings.Durable,
                                                                       settings.AutoDelete, settings.ExchangeArguments);

            if (settings.BindQueue)
            {
                topologyBuilder.Queue = topologyBuilder.QueueDeclare(settings.QueueName, settings.Durable, queueAutoDelete, settings.Exclusive, queueArguments);

                topologyBuilder.QueueBind(topologyBuilder.Exchange, topologyBuilder.Queue, settings.RoutingKey, settings.BindingArguments);
            }

            _configuration.Topology.Consume.Apply(topologyBuilder);

            return(topologyBuilder.BuildBrokerTopology());
        }
Пример #2
0
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var topologyBuilder = new ReceiveEndpointBrokerTopologyBuilder();

            var queueArguments = new Dictionary <string, object>(settings.QueueArguments);

            bool queueAutoDelete = settings.AutoDelete;

            if (settings.QueueExpiration.HasValue)
            {
                queueArguments["x-expires"] = (long)settings.QueueExpiration.Value.TotalMilliseconds;
                queueAutoDelete             = false;
            }

            topologyBuilder.Queue = topologyBuilder.QueueDeclare(settings.QueueName, settings.Durable, queueAutoDelete, settings.Exclusive, queueArguments);

            topologyBuilder.Exchange = topologyBuilder.ExchangeDeclare(settings.ExchangeName ?? settings.QueueName, settings.ExchangeType, settings.Durable,
                                                                       settings.AutoDelete, settings.ExchangeArguments);

            topologyBuilder.QueueBind(topologyBuilder.Exchange, topologyBuilder.Queue, settings.RoutingKey, settings.BindingArguments);

            _configuration.Topology.Consume.Apply(topologyBuilder);

            return(topologyBuilder.BuildTopologyLayout());
        }
Пример #3
0
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var topologyBuilder = new ReceiveEndpointBrokerTopologyBuilder();

            topologyBuilder.Queue = topologyBuilder.CreateQueue(settings.GetQueueDescription());

            _configuration.Topology.Consume.Apply(topologyBuilder);

            return(topologyBuilder.BuildBrokerTopology());
        }
Пример #4
0
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var topologyBuilder = new ReceiveEndpointBrokerTopologyBuilder();

            topologyBuilder.Queue = topologyBuilder.CreateQueue(settings.EntityName, settings.Durable, settings.AutoDelete);

            _configuration.Topology.Consume.Apply(topologyBuilder);

            return(topologyBuilder.BuildTopologyLayout());
        }
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var builder = new ReceiveEndpointBrokerTopologyBuilder();

            builder.Queue = builder.CreateQueue(settings.EntityName, settings.Durable, settings.AutoDelete, settings.QueueAttributes, settings.QueueSubscriptionAttributes);

            _configuration.Topology.Consume.Apply(builder);

            return(builder.BuildTopologyLayout());
        }
        public void Setup()
        {
            _nameFormatter       = new ServiceBusMessageNameFormatter();
            _entityNameFormatter = new MessageNameFormatterEntityNameFormatter(_nameFormatter);
            _consumeTopology     = new ServiceBusConsumeTopology(AzureBusFactory.MessageTopology, new ServiceBusPublishTopology(AzureBusFactory.MessageTopology));

            _builder = new ReceiveEndpointBrokerTopologyBuilder();

            _inputQueueName = "input-queue";
            _builder.Queue  = _builder.CreateQueue(new QueueConfigurator(_inputQueueName).GetQueueDescription());
        }
Пример #7
0
        public void Setup()
        {
            _nameFormatter       = new RabbitMqMessageNameFormatter();
            _entityNameFormatter = new MessageNameFormatterEntityNameFormatter(_nameFormatter);
            _consumeTopology     = new RabbitMqConsumeTopology(RabbitMqBusFactory.MessageTopology, new RabbitMqPublishTopology(RabbitMqBusFactory.MessageTopology));

            _builder = new ReceiveEndpointBrokerTopologyBuilder();

            _inputQueueName   = "input-queue";
            _builder.Queue    = _builder.QueueDeclare(_inputQueueName, true, false, false, new Dictionary <string, object>());
            _builder.Exchange = _builder.ExchangeDeclare(_inputQueueName, _consumeTopology.ExchangeTypeSelector.DefaultExchangeType, true, false,
                                                         new Dictionary <string, object>());
            _builder.QueueBind(_builder.Exchange, _builder.Queue, "", new Dictionary <string, object>());
        }
Пример #8
0
        BrokerTopology BuildTopology(ReceiveSettings settings)
        {
            var topologyBuilder = new ReceiveEndpointBrokerTopologyBuilder();

            topologyBuilder.Queue = topologyBuilder.QueueDeclare(settings.QueueName, settings.Durable, settings.AutoDelete, settings.Exclusive, settings.QueueArguments);

            topologyBuilder.Exchange = topologyBuilder.ExchangeDeclare(settings.ExchangeName ?? settings.QueueName, settings.ExchangeType, settings.Durable, settings.AutoDelete,
                                                                       settings.ExchangeArguments);

            topologyBuilder.QueueBind(topologyBuilder.Exchange, topologyBuilder.Queue, settings.RoutingKey, settings.BindingArguments);

            _configuration.Topology.Consume.Apply(topologyBuilder);

            return(topologyBuilder.BuildTopologyLayout());
        }