Example #1
0
        private void SendInternal(object message, IEnumerable <string> destinations)
        {
            OutgoingHeaders[StandardHeaders.ContentType]          = MessageSerializer.ContentType;
            OutgoingHeaders[StandardHeaders.EnclosedMessageTypes] = string.Join(",", MessageMapper.GetEnclosedMessageTypes(message.GetType()).Distinct());
            if (currentMessageContext != null)
            {
                OutgoingHeaders[StandardHeaders.RelatedTo] = currentMessageContext[StandardHeaders.MessageId];
            }
            var transportMessage = new OutgoingTransportMessage(OutgoingHeaders, message, MessageSerializer.Serialize(message));

            this.Transport.Send(transportMessage, destinations);
        }
Example #2
0
        public string RequestTimeoutMessage(int secondsToWait, object timeoutMessage)
        {
            OutgoingHeaders[StandardHeaders.TimeoutMessageTimeout] = secondsToWait.ToString();
            OutgoingHeaders[StandardHeaders.ContentType]           = MessageSerializer.ContentType;
            OutgoingHeaders[StandardHeaders.EnclosedMessageTypes]  = string.Join(",", MessageMapper.GetEnclosedMessageTypes(timeoutMessage.GetType()).Distinct());
            if (currentMessageContext != null)
            {
                OutgoingHeaders[StandardHeaders.RelatedTo] = currentMessageContext[StandardHeaders.MessageId];
            }
            var transportMessage = new OutgoingTransportMessage(OutgoingHeaders, timeoutMessage, MessageSerializer.Serialize(timeoutMessage));

            return(this.Transport.RequestTimeoutMessage(secondsToWait, transportMessage));
        }