示例#1
0
        public static AmpMessage CreateResponseMessage(string requestId)
        {
            var        data    = requestId.Split('|');
            AmpMessage message = new AmpMessage()
            {
                ServiceId         = ushort.Parse(data[0]),
                MessageId         = ushort.Parse(data[1]),
                InvokeMessageType = InvokeMessageType.Response
            };

            return(message);
        }
示例#2
0
        private static void AddAuditLog(ILogger writer, IAuditLoggerFormat <AmpMessage> format, AuditLogType logType, IRpcContext context, AmpMessage req, AmpMessage rsp, long elapsedMS)
        {
            if (writer == null || format == null)
            {
                return;
            }

            var entity = new AuditLogEntity()
            {
                Context   = context,
                Request   = req,
                Response  = rsp,
                ElapsedMS = elapsedMS,
                Writer    = writer,
                Formater  = format,
                LogType   = logType
            };

            logDict.Enqueue(entity);

            StartWrite();
        }
示例#3
0
 public void PushResponse(AmpMessage response)
 {
     _rsp = response;
 }
示例#4
0
 public void PushRequest(AmpMessage request)
 {
     _req = request;
 }