internal void Configure(RabbitMqTransport transport)
        {
            transport.AddClientProperties(_additionalClientProperties);

            if (DeclareExchanges.HasValue)
            {
                transport.SetDeclareExchanges(DeclareExchanges.Value);
            }

            if (DeclareInputQueue.HasValue)
            {
                transport.SetDeclareInputQueue(DeclareInputQueue.Value);
            }

            if (BindInputQueue.HasValue)
            {
                transport.SetBindInputQueue(BindInputQueue.Value);
            }

            if (DirectExchangeName != null)
            {
                transport.SetDirectExchangeName(DirectExchangeName);
            }

            if (TopicExchangeName != null)
            {
                transport.SetTopicExchangeName(TopicExchangeName);
            }

            if (MaxNumberOfMessagesToPrefetch != null)
            {
                transport.SetMaxMessagesToPrefetch(MaxNumberOfMessagesToPrefetch.Value);
            }
        }
        public async Task CanUseAlternateCustomExchangeName()
        {
            const string connectionString = RabbitMqTransportFactory.ConnectionString;

            var rabbitMqTransport = new RabbitMqTransport(connectionString, "inputQueue", new ConsoleLoggerFactory(false));

            var defaultTopicExchange = "defaultTopicExchange";

            rabbitMqTransport.SetTopicExchangeName(defaultTopicExchange);

            var topic             = "myTopic";
            var alternateExchange = "alternateExchange";

            var topicWithAlternateExchange = $"{topic}@{alternateExchange}";

            var subscriberAddresses = await rabbitMqTransport.GetSubscriberAddresses(topicWithAlternateExchange);

            Assert.That(subscriberAddresses[0], Is.EqualTo(topicWithAlternateExchange));

            subscriberAddresses = await rabbitMqTransport.GetSubscriberAddresses(topic);

            Assert.That(subscriberAddresses[0], Is.EqualTo($"{topic}@{defaultTopicExchange}"));

            subscriberAddresses = await rabbitMqTransport.GetSubscriberAddresses(topic + '@');

            Assert.That(subscriberAddresses[0], Is.EqualTo($"{topic}@"));
        }
        internal void Configure(RabbitMqTransport transport)
        {
            transport.AddClientProperties(_additionalClientProperties);

            if (SslSettings != null)
            {
                transport.SetSslSettings(SslSettings);
            }

            if (DeclareExchanges.HasValue)
            {
                transport.SetDeclareExchanges(DeclareExchanges.Value);
            }

            if (DeclareInputQueue.HasValue)
            {
                transport.SetDeclareInputQueue(DeclareInputQueue.Value);
            }

            if (BindInputQueue.HasValue)
            {
                transport.SetBindInputQueue(BindInputQueue.Value);
            }

            if (DirectExchangeName != null)
            {
                transport.SetDirectExchangeName(DirectExchangeName);
            }

            if (TopicExchangeName != null)
            {
                transport.SetTopicExchangeName(TopicExchangeName);
            }

            if (MaxNumberOfMessagesToPrefetch != null)
            {
                transport.SetMaxMessagesToPrefetch(MaxNumberOfMessagesToPrefetch.Value);
            }

            if (CallbackOptionsBuilder != null)
            {
                transport.SetCallbackOptions(CallbackOptionsBuilder);
            }

            if (PublisherConfirmsEnabled.HasValue)
            {
                transport.EnablePublisherConfirms(PublisherConfirmsEnabled.Value);
            }

            transport.SetInputQueueOptions(InputQueueOptionsBuilder);
            transport.SetDefaultQueueOptions(DefaultQueueOptionsBuilder);
            transport.SetExchangeOptions(ExchangeOptions);
            transport.SetMaxPollingTimeout(MaxPollingTimeout);
            transport.SetMaxWriterPoolSize(MaxWriterPoolSize);
        }
Пример #4
0
        internal void Configure(RabbitMqTransport transport)
        {
            transport.AddClientProperties(_additionalClientProperties);

            if (SslSettings != null)
            {
                transport.SetSslSettings(SslSettings);
            }

            if (DeclareExchanges.HasValue)
            {
                transport.SetDeclareExchanges(DeclareExchanges.Value);
            }

            if (DeclareInputQueue.HasValue)
            {
                transport.SetDeclareInputQueue(DeclareInputQueue.Value);
            }

            if (BindInputQueue.HasValue)
            {
                transport.SetBindInputQueue(BindInputQueue.Value);
            }

            if (DirectExchangeName != null)
            {
                transport.SetDirectExchangeName(DirectExchangeName);
            }

            if (TopicExchangeName != null)
            {
                transport.SetTopicExchangeName(TopicExchangeName);
            }

            if (MaxNumberOfMessagesToPrefetch != null)
            {
                transport.SetMaxMessagesToPrefetch(MaxNumberOfMessagesToPrefetch.Value);
            }

            if (CallbackOptionsBuilder != null)
            {
                transport.SetCallbackOptions(CallbackOptionsBuilder);
            }

            transport.SetInputQueueOptions(QueueOptions);
        }