/// <summary>
        /// This constructor is only used in the receive path from Amqp path,
        /// or in Cloning from a Message that has serialized.
        /// </summary>
        /// <param name="amqpMessage"></param>
        internal Message(AmqpMessage amqpMessage)
            : this()
        {
            if (amqpMessage == null)
            {
                throw Fx.Exception.ArgumentNull(nameof(amqpMessage));
            }

            MessageConverter.UpdateMessageHeaderAndProperties(amqpMessage, this);
            Stream stream = amqpMessage.BodyStream;

            this.InitializeWithStream(stream, true);
        }
示例#2
0
        /// <summary>
        /// This constructor is only used in the receive path from AMQP path, or in cloning from a Message that has serialized.
        /// </summary>
        /// <param name="amqpMessage">The AMQP message received, or the message to be cloned.</param>
        internal Message(AmqpMessage amqpMessage)
            : this()
        {
            if (amqpMessage == null)
            {
                throw Fx.Exception.ArgumentNull(nameof(amqpMessage));
            }

            MessageConverter.UpdateMessageHeaderAndProperties(amqpMessage, this);
            Stream stream = amqpMessage.BodyStream;

            InitializeWithStream(stream, StreamDisposalResponsibility.Sdk);
        }