協調流程引擎設定
協調流程引擎使用名為 BTSNTSvc.exe.config 的 XML 檔來判斷特定行為。 舉例來說,BTSNTSvc.exe.config 檔中的凍結屬性及其預設值是設定為 XML,並且在所有包含協調流程的主控件執行個體啟動時被讀取。 如需詳細資訊,請參閱 協調流程解除凍結和解除凍結。
服務會在啟動時讀取一次這項組態資訊。 除非服務停止並重新啟動,否則不會取得對服務所做的任何變更。
請參閱下列有關不同節點和可能值的範例。
範例:啟動所有驗證
<?xml version="1.0" ?>
<configuration>
<configSections>
<section
name="xlangs"
type="Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking" />
</assemblyBinding>
</runtime>
<xlangs>
<Configuration>
<Debugging
ValidateAssemblies="true"
ValidateSchemas="true"
ValidateCorrelations="true"
ExtendedLogging="true"
/>
</Configuration>
</xlangs>
</configuration>
範例:僅組件驗證
<?xml version="1.0" ?>
<configuration>
<configSections>
<section
name="xlangs"
type="Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess"
/>
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking" />
</assemblyBinding>
</runtime>
<xlangs>
<Configuration>
<Debugging
ValidateAssemblies="true"
ExtendedLogging="false"
/>
</Configuration>
</xlangs>
</configuration>
範例:啟用遠端偵錯
<?xml version="1.0" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking" />
</assemblyBinding>
</runtime>
<system.runtime.remoting>
<customErrors mode="on"/>
<channelSinkProviders>
<serverProviders>
<provider id="sspi"
type="Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine" securityPackage="negotiate" authenticationLevel="packetPrivacy" />
</serverProviders>
</channelSinkProviders>
<application>
<channels>
<channel ref="tcp" port="0" name="">
<serverProviders>
<provider ref="sspi" />
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
範例:AppDomain 組態
組件是透過指派規則 (下列將詳細說明) 指派到具名網域。 如果某些組件沒有指定規則,那些組件將會指派到臨機操作 (Ad Hoc) 網域。 每個臨機操作網域中這類指派的組件數目取決於 AssembliesPerDomain 的值。
<?xml version="1.0" ?>
<configuration>
<configSections>
<section name="xlangs" type="Microsoft.XLANGs.BizTalk.CrossProcess.XmlSerializationConfigurationSectionHandler, Microsoft.XLANGs.BizTalk.CrossProcess" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="BizTalk Assemblies;Developer Tools;Tracking" />
</assemblyBinding>
</runtime>
<xlangs>
<Configuration>
<!--
<!--
AppDomain configuration.
Assemblies are assigned to named domains using assignment rules (see more below). If no rule is specified for some assembly, the assembly will be assigned to an ad hoc domain. The number of such assigned assemblies per ad hoc domain is determined by the value of AssembliesPerDomain.
-->-->
<AppDomains AssembliesPerDomain="10">
<!--
<!--
In this section the user may specify defualt configuration for any app domain created that does not have a named configuration associated with it (see AppDomainSpecs below)
SecondsEmptyBeforeShutdown is the number of seconds that an app domain is empty (that is, it does not contain any orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload, even when empty.
Similarly, SecondsIdleBeforeShutdown is the number of seconds that an app domain is idle (that is, it contains only dehydratable orchestrations) before being unloaded. Specify -1 to signal that an app domain should never unload when idle but not empty. When an idle but non-empty domain is shut down, all of the contained instances are dehydrated first.
-->
-->
<DefaultSpec SecondsIdleBeforeShutdown="1200" SecondsEmptyBeforeShutdown="1800">
<!--
<!--
BaseSetup is a serialized System.AppDomainSetup object. This is passed as-is to
AppDomain.CreateAppDomain() and can be used to influence assembly search path etc.
-->
-->
<BaseSetup>
<ApplicationBase>c:\myAppBase</ApplicationBase>_0</ApplicationBase>
<ConfigurationFile>c:\myAppBase\myConfig.config</ConfigurationFile>_0</ConfigurationFile>
<DynamicBase>DynamicBase_0</DynamicBase>
<DisallowPublisherPolicy>true</DisallowPublisherPolicy>
<ApplicationName>ApplicationName_0</ApplicationName>
<PrivateBinPath>PrivateBinPath_0</PrivateBinPath>
<PrivateBinPathProbe>PrivateBinPathProbe_0</PrivateBinPathProbe>
<ShadowCopyDirectories>ShadowCopyDirectories_0</ShadowCopyDirectories>
<ShadowCopyFiles>ShadowCopyFiles_0</ShadowCopyFiles>
<CachePath>CachePath_0</CachePath>
<LicenseFile>LicenseFile_0</LicenseFile>
<LoaderOptimization>NotSpecified</LoaderOptimization>
</BaseSetup>
</DefaultSpec>
<!--
- <!--
In this section the user may specify named configurations for specific app domains, identified by their "friendly name". The format of any app-domain spec is identical to that of the default app-domain spec.
-->-->
<AppDomainSpecs>
<AppDomainSpec Name="MyDomain1" SecondsIdleBeforeShutdown="-1" SecondsEmptyBeforeShutdown="12000">
<BaseSetup>
<PrivateBinPath>c:\PathForAppDomain1</PrivateBinPath>
<PrivateBinPath>PrivateBinPath_0</PrivateBinPath>
<PrivateBinPathProbe>PrivateBinPathProbe_0</PrivateBinPathProbe>
</BaseSetup>
</AppDomainSpec>
<AppDomainSpec Name="MyFrequentlyUnloadingDomainMyTrashyDomain" SecondsIdleBeforeShutdown="60" SecondsEmptyBeforeShutdown="60" />
</AppDomainSpecs>
<!--
<!--
The PatternAssignmentRules and ExactAssignmentRules control assignment of assemblies to app domains.
When a message arrives, the name of its corresponding orchestration's assembly is determined. Then, the assembly is assigned an app domain name. The rules guide this assignment. Exact rules are consulted first, in their order of definition, and then the pattern rules. The first match is used.
If no match is found, the assembly will be assigned to an ad-hoc domain. The configuration and number of assemblies per ad-hoc domain is controlled by the AssembliesPerDomain attribute and the DefaultSpec section.
-->
-->
- <ExactAssignmentRules>
<!--
<!--
An exact assembly rule specifies a strong assembly name and an app domain name. If the strong assembly name equals the rule's assembly name, it is assigned to the corresponding app domain.
-->-->
<ExactAssignmentRule AssemblyName="BTSAssembly1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c7731c5584592ad"
AssemblyName_0" AppDomainName="MyDomain1" />AppDomainName_1" />
<ExactAssignmentRule AssemblyName="BTSAssembly2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c7731c5584592ad"AssemblyName_0" AppDomainName="AppDomainName_1" />
AppDomainName="MyFrequentlyUnloadingDomain " />
<ExactAssignmentRule AssemblyName="AssemblyName_0" AppDomainName="AppDomainName_1" />
</ExactAssignmentRules>
<PatternAssignmentRules>
<!--
<!--
A pattern assignment rule specifies a regular expression and an app domain name. If the strong assembly name matches the expression, it is assigned to the corresponding app domain. This allows version independent assignment, assignment by public key token, or assignment by the custom assembly key.
-->-->
<!--
assign all assemblies with name BTSAssembly3, regardless of version and public key,
to the MyDomain1 app domain
-->
<PatternAssignmentRule AssemblyNamePattern=" BTSAssembly3, Version=\d.\d.\d.\d, Culture=neutral, PublicKeyToken=.{16}"AssemblyNamePattern_0" AppDomainName=" MyDomain1" />
<PatternAssignmentRule AssemblyNamePattern="AssemblyNamePattern_0" AppDomainName="AppDomainName_1" />
<PatternAssignmentRule AssemblyNamePattern="AssemblyNamePattern_0" AppDomainName="AppDomainName_1" />
</PatternAssignmentRules>
</AppDomains>
</Configuration>
</xlangs>
</configuration>
修改 BTSNTSvc.exe.config 檔案的其他區段
如需修改 BTSNTSvc.exe.config 中解除凍結值的資訊,請參閱 解除凍結預設屬性。
BTSNTSvc.exe 組態檔包含 .NET Framework General Reference 中記載的數個其他區段。 如需有關修改這些章節的詳細資訊,請參閱 上的 .NET Framework 一般參考 https://go.microsoft.com/FWLink/?LinkID=52964 的組態檔架構。
除了 BizTalk 特定的組態資訊之外,BTSNTSvc.exe.config 檔案也是在協調流程內容中執行的 .NET 應用程式元件,配接器或管線會在執行時間使用組態標籤下< 的標準 .NET appSettings 標籤來取得其組態 >資訊。>< 因為 BizTalk 已經提供自訂配接器和管線元件的機制來取得組態資訊,< 所以 BTSNTSvc.exe.config 檔案中的 appSettings >標籤通常會由協調流程內呼叫的自訂 .NET 元件使用。 例如:
<appSettings>
<add key="configParamName" value="configParamValue" />
</appSettings>
在個別協調流程中進行訊息節流
btsntsvc.exe.config 檔案中指定的這個屬性將會限制協調流程所能含有的未處理訊息數目,使協調流程不致於耗用太多記憶體。 所有訊息會繼續傳遞至 MessageBox,不過,在協調流程處理一些未處理的訊息之前,已排入佇列的訊息將不會傳遞至協調流程。
若要在位於BizTalk Server根目錄) (btsntsvc.exe.config 檔案中指定此屬性,請在 [應用程式] 節點下新增下列參數:
<configuration>
<application>
<Throttling PauseAt="100" ResumeAt="50" />
</application>
</configuration>
在這個範例中,一旦協調流程含有 100 個未處理的訊息,MessageBox 就會停止傳送其他訊息。 當協調流程的未處理訊息數目降到 50 個時,就會指示 MessageBox 繼續傳送訊息。 您可以指定其他值。
您也必須針對資料庫中的每個主控件啟用這個功能。 若要啟用主控件的訊息節流,您必須編輯 BizTalkMsgBoxDb 資料庫中的 dbo.Applications 資料表。 針對您想要針對每個協調流程啟用訊息節流的每個主機,請將 fAttributes 旗標位設定為 1。 只有將 fAttribute 設定為 1 的主機,才會允許每個協調流程的訊息節流。