Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new <see cref="AmqpMessageHeader"/> instance by copying the passed in
 /// AMQP message transport header.
 /// </summary>
 /// <param name="header">The AMQP message transport header to copy.</param>
 internal AmqpMessageHeader(AmqpMessageHeader header)
 {
     Durable       = header.Durable;
     Priority      = header.Priority;
     TimeToLive    = header.TimeToLive;
     FirstAcquirer = header.FirstAcquirer;
     DeliveryCount = header.DeliveryCount;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new <see cref="AmqpAnnotatedMessage"/> instance by copying the passed in message.
 /// </summary>
 /// <param name="message">The message to copy.</param>
 public AmqpAnnotatedMessage(AmqpAnnotatedMessage message)
 {
     Body = message.Body;
     ApplicationProperties = new Dictionary <string, object>(message.ApplicationProperties);
     Properties            = new AmqpMessageProperties(message.Properties);
     MessageAnnotations    = new Dictionary <string, object>(message.MessageAnnotations);
     DeliveryAnnotations   = new Dictionary <string, object>(message.DeliveryAnnotations);
     Footer = new Dictionary <string, object>(message.Footer);
     Header = new AmqpMessageHeader(message.Header);
 }
        /// <summary>
        /// Initializes a new <see cref="AmqpAnnotatedMessage"/> instance by copying the passed in message.
        /// </summary>
        /// <param name="messageToCopy">The message to copy.</param>
        public AmqpAnnotatedMessage(AmqpAnnotatedMessage messageToCopy)
        {
            Argument.AssertNotNull(messageToCopy, nameof(messageToCopy));

            var data = messageToCopy.Body as AmqpDataMessageBody;

            Body = new AmqpDataMessageBody(data !.Data);
            _applicationProperties = new Dictionary <string, object>(messageToCopy.ApplicationProperties);
            Properties             = new AmqpMessageProperties(messageToCopy.Properties);
            _messageAnnotations    = new Dictionary <string, object>(messageToCopy.MessageAnnotations);
            _deliveryAnnotations   = new Dictionary <string, object>(messageToCopy.DeliveryAnnotations);
            _footer = new Dictionary <string, object>(messageToCopy.Footer);
            Header  = new AmqpMessageHeader(messageToCopy.Header);
        }