コード例 #1
0
        public void Bind()
        {
            if (!IsBindableMessageType)
            {
                _specifications.Add(new InvalidInMemoryConsumeTopologySpecification(TypeMetadataCache <TMessage> .ShortName, "Is not a bindable message type"));
                return;
            }

            var specification = new ExchangeBindingConsumeTopologySpecification(_messageTopology.EntityName);

            _specifications.Add(specification);
        }
コード例 #2
0
        public void Bind(string exchangeName, Action <IExchangeBindingConfigurator> configure = null)
        {
            var exchangeType = ExchangeTypeSelector.DefaultExchangeType;

            var binding = new ExchangeBindingConfigurator(exchangeName, exchangeType, true, false, "");

            configure?.Invoke(binding);

            var specification = new ExchangeBindingConsumeTopologySpecification(binding);

            _specifications.Add(specification);
        }
コード例 #3
0
        public void Bind(ExchangeType?exchangeType = default, string routingKey = default)
        {
            if (!IsBindableMessageType)
            {
                _specifications.Add(new InvalidGrpcConsumeTopologySpecification(TypeMetadataCache <TMessage> .ShortName, "Is not a bindable message type"));
                return;
            }

            var specification = new ExchangeBindingConsumeTopologySpecification(_messageTopology.EntityName, exchangeType ?? _publishTopology.ExchangeType,
                                                                                routingKey);

            _specifications.Add(specification);
        }
コード例 #4
0
        public void Bind(Action <IExchangeBindingConfigurator> configure = null)
        {
            if (!IsBindableMessageType)
            {
                _specifications.Add(new InvalidRabbitMqConsumeTopologySpecification(TypeMetadataCache <TMessage> .ShortName, "Is not a bindable message type"));
                return;
            }

            var specification = new ExchangeBindingConsumeTopologySpecification(_publishTopology.Exchange);

            configure?.Invoke(specification);

            _specifications.Add(specification);
        }
コード例 #5
0
        public void Bind(string exchangeName, Action <IExchangeBindingConfigurator> configure = null)
        {
            if (string.IsNullOrWhiteSpace(exchangeName))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(exchangeName));
            }

            var exchangeType = ExchangeTypeSelector.DefaultExchangeType;

            var specification = new ExchangeBindingConsumeTopologySpecification(exchangeName, exchangeType);

            configure?.Invoke(specification);

            _specifications.Add(specification);
        }
コード例 #6
0
        public void Bind(string exchangeName, ExchangeType exchangeType = ExchangeType.FanOut, string routingKey = default)
        {
            var specification = new ExchangeBindingConsumeTopologySpecification(exchangeName, exchangeType, routingKey);

            _specifications.Add(specification);
        }