TransactedBatchingBehavior.MaxBatchSize Propriedade

Definição

Obtém ou define o número máximo de operações de recebimento que juntas podem formar um lote em uma transação.Gets or sets the maximum number of receive operations that can be batched together in one transaction.

public:
 property int MaxBatchSize { int get(); void set(int value); };
public int MaxBatchSize { get; set; }
member this.MaxBatchSize : int with get, set
Public Property MaxBatchSize As Integer

Valor da propriedade

Int32

O número máximo de operações de recebimento que juntas podem formar um lote em uma transação.The maximum number of receive operations that can be batched together in one transaction.

Exceções

MaxBatchSize é menor que 0.MaxBatchSize is less than 0.

Exemplos

O código a seguir mostra como definir a MaxBatchSize propriedade.The following code shows how to set the MaxBatchSize property.

ServiceEndpoint endpoint;
endpoint = serviceHost.AddServiceEndpoint(typeof(IQueueCalculator), new NetMsmqBinding(),"net.msmq://localhost/private/ServiceModelSamples");
TransactedBatchingBehavior batchBehavior = new TransactedBatchingBehavior(10);
batchBehavior.MaxBatchSize = 100;
endpoint.Behaviors.Add(new TransactedBatchingBehavior(10));

Comentários

O maxBatchSize valor é apenas uma dica.The maxBatchSize value is only a hint. É possível que todas as mensagens sejam recebidas antes de alcançar o maxBatchSize .It is possible that all messages are received before reaching the maxBatchSize. Quando isso ocorre, é desnecessário aguardar indefinidamente que outra mensagem seja recebida.When that occurs, it is unnecessary to wait indefinitely for another message to be received. Para evitar que isso aconteça, o WCF confirma o lote antecipadamente e abre um novo lote para receber mensagens adicionais.To prevent this from happening, WCF commits the batch early and open a new batch to receive additional messages. O lote será confirmado se não houver nenhuma mensagem a ser recebida e 20 por cento do valor de tempo limite da transação tiver decorrido.The batch is committed if there are no messages to be received and 20 percent of the transaction time-out value has elapsed.

Aplica-se a