Example #1
0
        public static void CopyTo(this MessageProperties messageProperties, IBasicProperties basicProperties)
        {
            if (messageProperties.IsContentTypePresent())
            {
                basicProperties.ContentType = messageProperties.ContentType;
            }
            if (messageProperties.IsContentEncodingPresent())
            {
                basicProperties.ContentEncoding = messageProperties.ContentEncoding;
            }
            if (messageProperties.IsDeliveryModePresent())
            {
                basicProperties.DeliveryMode = messageProperties.DeliveryMode;
            }
            if (messageProperties.IsPriorityPresent())
            {
                basicProperties.Priority = messageProperties.Priority;
            }
            if (messageProperties.IsCorrelationIdPresent())
            {
                basicProperties.CorrelationId = messageProperties.CorrelationId;
            }
            if (messageProperties.IsReplyToPresent())
            {
                basicProperties.ReplyTo = messageProperties.ReplyTo;
            }
            if (messageProperties.IsExpirationPresent())
            {
                basicProperties.Expiration = messageProperties.Expiration;
            }
            if (messageProperties.IsMessageIdPresent())
            {
                basicProperties.MessageId = messageProperties.MessageId;
            }
            if (messageProperties.IsTimestampPresent())
            {
                basicProperties.Timestamp = new AmqpTimestamp(messageProperties.Timestamp);
            }
            if (messageProperties.IsTypePresent())
            {
                basicProperties.Type = messageProperties.Type;
            }
            if (messageProperties.IsUserIdPresent())
            {
                basicProperties.UserId = messageProperties.UserId;
            }
            if (messageProperties.IsAppIdPresent())
            {
                basicProperties.AppId = messageProperties.AppId;
            }
            if (messageProperties.IsClusterIdPresent())
            {
                basicProperties.ClusterId = messageProperties.ClusterId;
            }

            if (messageProperties.IsHeadersPresent())
            {
                basicProperties.Headers = new Hashtable(messageProperties.Headers);
            }
        }