Exemplo n.º 1
0
        protected override IEnumerable <string> GetQueryStringOptions()
        {
            foreach (var option in base.GetQueryStringOptions())
            {
                yield return(option);
            }

            if (_bindToQueue)
            {
                yield return("bind=true");
            }

            if (!string.IsNullOrWhiteSpace(_queueName))
            {
                yield return("queue=" + WebUtility.UrlEncode(_queueName));
            }

            if (ExchangeArguments != null && ExchangeArguments.ContainsKey("x-delayed-type"))
            {
                yield return("delayedType=" + ExchangeArguments["x-delayed-type"]);
            }

            foreach (var binding in _exchangeBindings)
            {
                yield return($"bindexchange={binding.ExchangeName}");
            }
        }
Exemplo n.º 2
0
 public void SetExchangeArgument(string key, object value)
 {
     if (!ExchangeArguments.ContainsKey(key))
     {
         ExchangeArguments.Add(key, value);
     }
 }
Exemplo n.º 3
0
 public Uri GetSendAddress(Uri hostAddress)
 {
     return(new RabbitMqEndpointAddress(hostAddress, ExchangeName, ExchangeType, Durable, AutoDelete, _bindToQueue, _queueName,
                                        ExchangeArguments.ContainsKey("x-delayed-type") ? (string)ExchangeArguments["x-delayed-type"] : default,