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); }
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()); }
protected virtual void OnTryPeek(Ptr ptr, IQueueItem item, bool result) { QLogger.DebugFormat("TryPeek {0} item:{1}", result, item.Print()); }
protected virtual void OnTryDequeue(Ptr ptr, IQueueItem item, bool result) { Logger.Debug("TryDequeue {0} item:{1}", result, item.Print()); }