예제 #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);
        }
예제 #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));
        }