/// <summary>
        /// Decodes the replyto field if one is set.
        ///
        /// Splits a replyto field containing an exchange name followed by a ':', followed by a routing key into the exchange name and
        /// routing key seperately. The exchange name may be empty in which case the empty string is returned. If the exchange name is
        /// empty the replyto field is expected to being with ':'.
        ///
        /// Anyhting other than a two part replyto field sperated with a ':' will result in an exception.
        /// </summary>
        ///
        /// <returns>A destination initialized to the replyto location if a replyto field was set, or an empty destination otherwise.</returns>
        private BindingURL ReadReplyToHeader()
        {
            string replyToEncoding = ContentHeaderProperties.ReplyTo;

            //log.Debug("replyToEncoding = " + replyToEncoding);
            if (string.IsNullOrEmpty(replyToEncoding))
            {
                return(null);
            }
            BindingURL bindingUrl = new BindingURL(replyToEncoding);

            //log.Debug("bindingUrl = " + bindingUrl.ToString());

            return(bindingUrl);

            //log.Info("replyToEncoding = " + replyToEncoding);

//             if ( replyToEncoding == null )
//             {
//                 return new Dest();
//             } else
//             {
//                 // Split the replyto field on a ':'
//                 string[] split = replyToEncoding.Split(':');

//                 // Ensure that the replyto field argument only consisted of two parts.
//                 if ( split.Length != 2 )
//                 {
//                     throw new QpidException("Illegal value in ReplyTo property: " + replyToEncoding);
//                 }

//                 // Extract the exchange name and routing key from the split replyto field.
//                 string exchangeName = split[0];

//                 string[] split2 = split[1].Split('/');
//                 string routingKey = split2[3];

//                 return new Dest(exchangeName, routingKey);
//             }
        }
Exemplo n.º 2
0
 private void WriteReplyToHeader(BindingURL dest)
 {
     string encodedDestination = string.Format("{0}:{1}", dest.ExchangeName, dest.RoutingKey);
     ContentHeaderProperties.ReplyTo = encodedDestination;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Decodes the replyto field if one is set.
        /// 
        /// Splits a replyto field containing an exchange name followed by a ':', followed by a routing key into the exchange name and
        /// routing key seperately. The exchange name may be empty in which case the empty string is returned. If the exchange name is
        /// empty the replyto field is expected to being with ':'.
        /// 
        /// Anyhting other than a two part replyto field sperated with a ':' will result in an exception.
        /// </summary>
        /// 
        /// <returns>A destination initialized to the replyto location if a replyto field was set, or an empty destination otherwise.</returns>
        private BindingURL ReadReplyToHeader()
        {
            string replyToEncoding = ContentHeaderProperties.ReplyTo;
            //log.Debug("replyToEncoding = " + replyToEncoding);
            if (string.IsNullOrEmpty(replyToEncoding))
            {
                return null;
            }
            BindingURL bindingUrl = new BindingURL(replyToEncoding);
            //log.Debug("bindingUrl = " + bindingUrl.ToString());

            return bindingUrl;
           
            //log.Info("replyToEncoding = " + replyToEncoding);

//             if ( replyToEncoding == null )
//             {
//                 return new Dest();
//             } else
//             {
//                 // Split the replyto field on a ':'
//                 string[] split = replyToEncoding.Split(':');

//                 // Ensure that the replyto field argument only consisted of two parts.
//                 if ( split.Length != 2 )
//                 {
//                     throw new QpidException("Illegal value in ReplyTo property: " + replyToEncoding);
//                 }

//                 // Extract the exchange name and routing key from the split replyto field.
//                 string exchangeName = split[0];

//                 string[] split2 = split[1].Split('/');
//                 string routingKey = split2[3];

//                 return new Dest(exchangeName, routingKey);
//             }
        }
        private void WriteReplyToHeader(BindingURL dest)
        {
            string encodedDestination = string.Format("{0}:{1}", dest.ExchangeName, dest.RoutingKey);

            ContentHeaderProperties.ReplyTo = encodedDestination;
        }