共用方式為


<transactedBatching>

指定是否支援接收作業的交易批次處理。

<configuration>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior>
          <transactedBatching>

Syntax

<transactedBatching maxBatchSize="Integer" />

屬性和項目

下列章節說明屬性、子元素和父元素。

屬性

屬性 描述
maxBatchSize 整數,指定可在一個異動中批次處理的接收作業數目上限。 預設值是 0。

子元素

無。

父項目

元素 描述
<behavior> 指定端點行為。

備註

以異動批次設定的傳輸,會嘗試將數個接收作業批次到一個異動中。 如此一來,即可避免在每個接收作業中建立並認可異動時的相對高成本。

範例

下列範例會示範如何在組態檔中將交易的批次處理行為加入至服務。

<system.serviceModel>
  <services>
    <service name="Microsoft.ServiceModel.Samples.CalculatorService"
             behaviorConfiguration="CalculatorServiceBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost:8000/ServiceModelSamples/service" />
        </baseAddresses>
      </host>
      <!-- Define NetMsmqEndpoint -->
      <endpoint address="net.msmq://localhost/private/ServiceModelSamples"
                binding="netMsmqBinding"
                contract="Microsoft.ServiceModel.Samples.IQueueCalculator" />
      <!-- the mex endpoint is exposed at http://localhost:8000/ServiceModelSamples/service/mex -->
      <endpoint address="mex"
                binding="mexHttpBinding"
                contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <endpointBehaviors>
      <behavior name="endpointBehavior">
        <transactedBatching maxBatchSize="10" />
      </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
      <behavior name="CalculatorServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

另請參閱