コード例 #1
0
        /// <summary>
        /// Creates an acknowledge message in response to a request.
        /// </summary>
        /// <param name="requestMessage">The original request message</param>
        /// <param name="body">The message body</param>
        /// <returns>The acknowledge message</returns>
        public static AcknowledgeMessage CreateAcknowledgeResponse(IMessage requestMessage, object body)
        {
            AcknowledgeMessage message = new AcknowledgeMessage();
            message.MessageId = Guid.NewGuid().ToString("D", CultureInfo.InvariantCulture);
            message.Headers = EmptyDictionary<string, object>.Instance;
            message.Body = body;
            message.ClientId = requestMessage.ClientId;
            message.Destination = requestMessage.Destination;
            message.CorrelationId = requestMessage.MessageId;

            return message;
        }
コード例 #2
0
        /// <summary>
        /// Creates an acknowledge message in response to a request.
        /// </summary>
        /// <param name="requestMessage">The original request message</param>
        /// <param name="body">The message body</param>
        /// <returns>The acknowledge message</returns>
        public static AcknowledgeMessage CreateAcknowledgeResponse(IMessage requestMessage, object body)
        {
            AcknowledgeMessage message = new AcknowledgeMessage();

            message.MessageId     = Guid.NewGuid().ToString("D", CultureInfo.InvariantCulture);
            message.Headers       = EmptyDictionary <string, object> .Instance;
            message.Body          = body;
            message.ClientId      = requestMessage.ClientId;
            message.Destination   = requestMessage.Destination;
            message.CorrelationId = requestMessage.MessageId;

            return(message);
        }