本文整理汇总了C#中Rhino.ServiceBus.Msmq.OpenedQueue.OpenSiblngQueue方法的典型用法代码示例。如果您正苦于以下问题:C# OpenedQueue.OpenSiblngQueue方法的具体用法?C# OpenedQueue.OpenSiblngQueue怎么用?C# OpenedQueue.OpenSiblngQueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino.ServiceBus.Msmq.OpenedQueue
的用法示例。
在下文中一共展示了OpenedQueue.OpenSiblngQueue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTimeoutMessages
/// <summary>
/// Gets a listing of all timeout messages.
/// </summary>
/// <returns></returns>
public IEnumerable<TimeoutInfo> GetTimeoutMessages(OpenedQueue queue)
{
using (var timeoutQueue = queue.OpenSiblngQueue(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))
};
}
}
}
示例2: TryMoveMessage
public bool TryMoveMessage(OpenedQueue queue, Message message, SubQueue subQueue, out string msgId)
{
using (var destinationQueue = queue.OpenSiblngQueue(subQueue, QueueAccessMode.Send))
{
Message receiveById;
try
{
receiveById = queue.ReceiveById(message.Id);
}
catch (InvalidOperationException)
{
msgId = null;
return false;
}
receiveById.AppSpecific = 0;//reset flag
destinationQueue.Send(receiveById);
msgId = receiveById.Id;
logger.DebugFormat("Moving messgage {0} from {1} to {2}, new id: {3}",
message.Id,
queue.RootUri,
destinationQueue.QueueUrl,
receiveById.Id);
return true;
}
}
示例3: OpenSubQueue
public OpenedQueue OpenSubQueue(OpenedQueue queue, SubQueue subQueue, QueueAccessMode accessMode)
{
return queue.OpenSiblngQueue(subQueue, accessMode);
}