示例#1
0
        public static TransStream DoResponse(IQueueItem item, MessageState state)
        {
            if (item == null)
            {
                return(null);
                //throw new MessageException(MessageState.MessageError, "Invalid queue item to write response");
            }

            var ts = ((QueueItem)item).ToTransStream(state);

            //((QueueItem)item).SetState(state);
            QLogger.Debug("QueueController DoResponse IQueueAck: {0}", item.Print());
            //return item.ToStream();

            return(ts);

            //if (item != null)
            //{
            //    ((QueueItem)item).SetState(state);
            //    return item.GetItemStream();
            //}
            //else
            //{
            //    Message response = Message.Ack(MessageState.UnExpectedError, new MessageException(MessageState.UnExpectedError, "WriteResponse error: there is no item stream to write reponse"));
            //    return response.ToStream();
            //}

            // QLogger.DebugFormat("Server WriteResponse State:{0}, MessageId: {1}", item.MessageState, item.MessageId);
        }
示例#2
0
 public static TransStream DoResponse(IQueueItem item)
 {
     if (item == null)
     {
         return(null);
         //throw new MessageException(MessageState.MessageError, "Invalid queue item to write response");
     }
     QLogger.Debug("QueueController DoResponse IQueueAck: {0}", item.Print());
     return(item.ToTransStream());
 }
示例#3
0
 protected virtual void OnTryPeek(Ptr ptr, IQueueItem item, bool result)
 {
     QLogger.DebugFormat("TryPeek {0} item:{1}", result, item.Print());
 }
示例#4
0
 protected virtual void OnTryDequeue(Ptr ptr, IQueueItem item, bool result)
 {
     Logger.Debug("TryDequeue {0} item:{1}", result, item.Print());
 }