AddHeaders() публичный Метод

Adds the headers.
public AddHeaders ( IMessage message, IAdditionalMessageData data ) : void
message IMessage The message.
data IAdditionalMessageData The data.
Результат void
Пример #1
0
        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        private IQueueOutputMessage InternalSend(T message, IAdditionalMessageData data)
        {
            Guard.NotNull(() => message, message);
            Guard.NotNull(() => data, data);

            if (!Configuration.IsReadOnly)
            {
                Configuration.SetReadOnly();
            }

            var additionalHeaders = _generateMessageHeaders.HeaderSetup(data);
            var messageToSend     = _messageFactory.Create(message, additionalHeaders);

            _addStandardMessageHeaders.AddHeaders(messageToSend, data);

            //send the message to the transport
            return(_sendMessages.Send(messageToSend, data));
        }
Пример #2
0
        private Tuple <IMessage, IAdditionalMessageData> SetupForSend(T message, IResponseId responseId, IAdditionalMessageData inputData)
        {
            var data = inputData ?? new AdditionalMessageData();

            if (!Configuration.IsReadOnly)
            {
                Configuration.SetReadOnly();
            }

            var additionalHeaders = _generateMessageHeaders.HeaderSetup(data);

            //construct our wrapper around the data to send
            var messageToSend = _messageFactory.Create(message, additionalHeaders);

            _addStandardMessageHeaders.AddHeaders(messageToSend, data);

            SetIpcInternalHeaders(messageToSend, responseId);

            return(new Tuple <IMessage, IAdditionalMessageData>(messageToSend, data));
        }