/// <summary> /// Moves the message from the timeout queue to the main queue. /// </summary> /// <param name="queue">The queue.</param> /// <param name="messageId">The message id.</param> public void MoveTimeoutToMainQueue(OpenedQueue queue, string messageId) { using (var timeoutQueue = queue.OpenSubQueue(SubQueue.Timeout, QueueAccessMode.Receive)) { var message = timeoutQueue.ReceiveById(messageId); message.AppSpecific = 0; // reset timeout flag queue.Send(message); } }
public OpenedQueue Open(QueueAccessMode access, IMessageFormatter formatter) { var messageQueue = new MessageQueue(QueuePath, access); if (formatter != null) { messageQueue.Formatter = formatter; } var openedQueue = new OpenedQueue(this, messageQueue, QueueUri.ToString(), Transactional) { Formatter = formatter }; if (SubQueue != null) { return(openedQueue.OpenSubQueue(SubQueue.Value, access)); } return(openedQueue); }
/// <summary> /// Gets a listing of all timeout messages. /// </summary> /// <returns></returns> public IEnumerable <TimeoutInfo> GetTimeoutMessages(OpenedQueue queue) { using (var timeoutQueue = queue.OpenSubQueue(SubQueue.Timeout, QueueAccessMode.Receive)) { var enumerator2 = timeoutQueue.GetMessageEnumerator2(); while (enumerator2.MoveNext()) { var message = enumerator2.Current; if (message == null || message.Extension.Length < 16) { continue; } yield return(new TimeoutInfo { Id = message.Id, Time = DateTime.FromBinary(BitConverter.ToInt64(message.Extension, 16)) }); } } }