导出 (0) 打印
全部展开

PrefetchCount 属性

注:本页面内容可能不完全适用中国大陆地区运营的 Windows Azure服务。如要了解不同地区 Windows Azure 服务的差异, 请参考本网站.

获取或设置消息接收器可同时请求的消息数。

命名空间:  Microsoft.ServiceBus.Messaging
程序集:  Microsoft.ServiceBus(在 Microsoft.ServiceBus.dll 中)

public int PrefetchCount { get; set; }

属性值

类型:System..::..Int32
消息接收器可同时请求的消息数。

This is a protected member of the abstract SubscriptionClient class. Abstract classes are not meant to be inherited, so protected members should be ignored.

You can use PrefetchCount to fetch multiple messages from the server in the same round-trip. This can be useful in scenarios that need lower latency for receiving existing messages from a queue or subscription. Prefetch can also improve throughput depending upon the scenarios as the number of round-trips to the server are reduced.

Prefetch is disabled by default. You can enable it by using this property on the client. You must set PrefetchCount before receiving the first message.

QueueClient client = factory.CreateQueueClient("queue1");
client.PrefetchCount = 200;

BrokeredMessage message = client.Receive();

社区附加资源

添加
显示:
© 2014 Microsoft