Share via


FabricTransportRemotingSettings.TryLoadFrom Method

Definition

Try to load the FabricTransport settings from a sectionName specified in the configuration file. Configuration File can be specified using the filePath or using the name of the configuration package specified in the service manifest. It will first try to load config using configPackageName. If configPackageName is not specified then try to load from filePath.

public static bool TryLoadFrom (string sectionName, out Microsoft.ServiceFabric.Services.Remoting.FabricTransport.FabricTransportRemotingSettings settings, string filepath = default, string configPackageName = default);
static member TryLoadFrom : string * FabricTransportRemotingSettings * string * string -> bool
Public Shared Function TryLoadFrom (sectionName As String, ByRef settings As FabricTransportRemotingSettings, Optional filepath As String = Nothing, Optional configPackageName As String = Nothing) As Boolean

Parameters

sectionName
String

The name of the section within the configuration file. If not found section in configuration file, it return false.

settings
FabricTransportRemotingSettings

When this method returns it sets the FabricTransportRemotingSettings settings if load from Config succeeded. If fails, its sets settings to null.

filepath
String

The full path of the file where the settings will be loaded from. If not specified , it will first try to load from default Config Package"Config" , if not found then load from Settings "ClientExeName.Settings.xml" present in Client Exe directory.

configPackageName
String

The name of the configuration package. If its null or empty, it will check for file in filePath.

Returns

Boolean specifies whether the settings get loaded successfully from Config. It returns true when load from Config succeeded, else return false.

Remarks

The following are the parameter names that should be provided in the configuration file,to be recognizable by service fabric to load the transport settings.

1. MaxQueueSize - MaxQueueSizevalue in long. 2. MaxMessageSize - MaxMessageSizevalue in bytes. 3. MaxConcurrentCalls - MaxConcurrentCallsvalue in long. 4. SecurityCredentials - SecurityCredentials value. 5. OperationTimeoutInSeconds - OperationTimeout value in seconds. 6. KeepAliveTimeoutInSeconds - KeepAliveTimeout value in seconds. 7. ConnectTimeoutInMilliseconds - ConnectTimeout value in milliseconds.

Applies to