Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,
Det här ämnet har inte bedömts ännu - Bedöm det här ämnet

SubscriptionClient.PrefetchCount Property

Gets or sets the number of messages that the message receiver can simultaneously request.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
abstract PrefetchCount : int with get, set
override PrefetchCount : int with get, set

Property Value

Type: System.Int32
The number of messages that the message receiver can simultaneously request.

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();
Var detta till hjälp?
(1500 tecken kvar)
Tack för dina kommentarer

Gruppinnehåll

Lägg till
Visa:
© 2014 Microsoft. Med ensamrätt.