本文整理汇总了C#中Rhino.ServiceBus.Msmq.OpenedQueue.OpenSubQueue方法的典型用法代码示例。如果您正苦于以下问题:C# OpenedQueue.OpenSubQueue方法的具体用法?C# OpenedQueue.OpenSubQueue怎么用?C# OpenedQueue.OpenSubQueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino.ServiceBus.Msmq.OpenedQueue
的用法示例。
在下文中一共展示了OpenedQueue.OpenSubQueue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveTimeoutToMainQueue
/// <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);
}
}
示例2: Open
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;
}
示例3: GetTimeoutMessages
/// <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)
continue;
yield return new TimeoutInfo
{
Id = message.Id,
Time = DateTime.FromBinary(BitConverter.ToInt64(message.Extension, 0))
};
}
}
}
示例4: OpenSubQueue
public OpenedQueue OpenSubQueue(OpenedQueue queue, SubQueue subQueue, QueueAccessMode accessMode)
{
return queue.OpenSubQueue(subQueue, accessMode);
}