銷售: 1-800-867-1380

SubscriptionClient.PrefetchCount 屬性

取得或設定訊息接收者可以同時要求的訊息數目。

命名空間:  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();
本文對您有任何幫助嗎?
(剩餘 1500 個字元)
感謝您提供意見

社群新增項目

新增
Microsoft 正展開一份線上問卷調查,了解您對於 MSDN 網站的看法。 如果您選擇參加,您離開 MSDN 網站時即會顯示線上問卷調查。

您是否想要參加?
顯示:
© 2015 Microsoft