共用方式為


<transactedBatching>

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

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

<transactedBatching maxBatchSize="Integer" />

屬性和項目

屬性

屬性 描述

maxBatchSize

整數,指定可在一個交易中批次處理的接收作業數目上限。預設值為 0。

子項目

無。

父項目

項目 描述

<endpointBehaviors> 的 <behavior>

指定端點行為。

備註

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

範例

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

<system.serviceModel>
  <services>
    <service name="Microsoft.ServiceModel.Samples.CalculatorService"
             behaviorConfiguration="CalculatorServiceBehavior">
      <host>
        <baseAddresses>
          <add baseAddress="https://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 explosed at https://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>

請參閱

參考

TransactedBatchingElement
TransactedBatchingBehavior