2
我想使用ScheduledEnqueueTimeUtc来安排消息供将来处理,但Peek只会返回活动消息和延迟消息。Peeking Azure ServiceBus消息不会返回预定消息
这是我用它来查看消息的代码:
public static async Task<IEnumerable<BrokeredMessage>> GetMessagesAsync(string connectionString, string queueName, int take)
{
var queue = QueueClient.CreateFromConnectionString(connectionString, queueName);
return await queue.PeekBatchAsync(take).ConfigureAwait(false);
}
与ScheduledEnqueueTimeUtc计划的消息设置为在将来某个时候都没有回来。
在预定的时间后,我得到State = Scheduled的消息,但这不是我所期望的。
从名称“ScheduledEnqueueTimeUtc”中可以看出消息由于尚未排入队列而不可见。但是,如果我可以在无法看到它们的情况下将无限数量的预定消息悬挂在那里,那么它会困扰我。
我犯了一个错误还是有另一种方法来获得未来的预定消息?