/// <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); }
/// <summary> /// Initializes a new <see cref="AmqpMessageProperties"/> instance by copying the passed in properties. /// </summary> /// <param name="properties">The properties to copy.</param> public AmqpMessageProperties(AmqpMessageProperties properties) { MessageId = properties.MessageId; UserId = properties.UserId; To = properties.To; Subject = properties.Subject; ReplyTo = properties.ReplyTo; CorrelationId = properties.CorrelationId; ContentType = properties.ContentType; ContentEncoding = properties.ContentEncoding; AbsoluteExpiryTime = properties.AbsoluteExpiryTime; CreationTime = properties.CreationTime; GroupId = properties.GroupId; GroupSequence = properties.GroupSequence; ReplyToGroupId = properties.ReplyToGroupId; }