示例#1
0
文件: Message.cs 项目: lulzzz/kino
        internal static Message FromMultipartMessage(MultipartMessage multipartMessage)
        {
            var(traceOptions, distributionPattern) = multipartMessage.GetTraceOptionsDistributionPattern();
            var(routes, hops) = multipartMessage.GetMessageRouting();

            return(new Message(multipartMessage.GetMessageIdentity(),
                               multipartMessage.GetMessageVersion().GetUShort(),
                               multipartMessage.GetMessagePartition())
            {
                WireFormatVersion = multipartMessage.GetWireFormatVersion().GetInt(),
                Body = multipartMessage.GetMessageBody(),
                TTL = multipartMessage.GetMessageTTL(),
                CorrelationId = multipartMessage.GetCorrelationId(),
                Signature = multipartMessage.GetSignature(),
                Domain = multipartMessage.GetDomain(),
                TraceOptions = traceOptions,
                Distribution = distributionPattern,
                CallbackReceiverIdentity = multipartMessage.GetCallbackReceiverIdentity(),
                CallbackReceiverNodeIdentity = multipartMessage.GetCallbackReceiverNodeIdentity(),
                CallbackPoint = multipartMessage.GetCallbackPoints(),
                CallbackKey = multipartMessage.GetCallbackKey(),
                ReceiverNodeIdentity = multipartMessage.GetReceiverNodeIdentity(),
                ReceiverIdentity = multipartMessage.GetReceiverIdentity(),
                routing = routes,
                Hops = hops
            });
        }