Share via


FabricClient Constructors

Definition

Overloads

FabricClient()

Initializes a new instance of the FabricClient class. This constructor should be used by code that is running inside the cluster. It allows the FabricClient instance to connect to the cluster via the local Gateway service running on the same node.

FabricClient(FabricClientRole)

Initializes a new instance of the FabricClient class with the specified fabric client role - FabricClientRole.

FabricClient(FabricClientSettings)

Initializes a new instance of the FabricClient class with the desired FabricClientSettings. If the FabricClient is on the same cluster as the service, then use a Local FabricClient. Local FabricClient is a feature of Service Fabric that allows the FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local FabricClient, as it enables automatic load balancing and improves performance.

FabricClient(String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses. These host-endpoints are list of ':' delimited strings where the first part is the ip of the cluster and the second part is the client-connection endpoint-port.

FabricClient(FabricClientSettings, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses and the desired FabricClientSettings.

FabricClient(SecurityCredentials, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses and SecurityCredentials.

FabricClient(TimeSpan, String[])
Obsolete.

DEPRECATED. Initializes a new instance of the FabricClient class with given keepAliveInterval and Service Fabric Gateway addresses (hostEndpoints).

FabricClient(SecurityCredentials, FabricClientSettings, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses, SecurityCredentials and FabricClientSettings.

FabricClient(SecurityCredentials, TimeSpan, String[])
Obsolete.

DEPRECATED. Initializes a new instance of the FabricClient class with given credentials, keepAliveInterval and Service Fabric Gateway addresses (hostEndpoints).

FabricClient()

Initializes a new instance of the FabricClient class. This constructor should be used by code that is running inside the cluster. It allows the FabricClient instance to connect to the cluster via the local Gateway service running on the same node.

public FabricClient ();
Public Sub New ()

Remarks

Since this constructor uses the local Gateway service running on the same node to connect to th cluster, your client can bypass an extra network hop. To connect to a cluster from code running outside the cluster, use a different constructor which allows you to explicitly specify the connection parameters.

Applies to

FabricClient(FabricClientRole)

Initializes a new instance of the FabricClient class with the specified fabric client role - FabricClientRole.

public FabricClient (System.Fabric.FabricClientRole clientRole);
new System.Fabric.FabricClient : System.Fabric.FabricClientRole -> System.Fabric.FabricClient
Public Sub New (clientRole As FabricClientRole)

Parameters

clientRole
FabricClientRole

The fabric client role.

Applies to

FabricClient(FabricClientSettings)

Initializes a new instance of the FabricClient class with the desired FabricClientSettings. If the FabricClient is on the same cluster as the service, then use a Local FabricClient. Local FabricClient is a feature of Service Fabric that allows the FabricClient to connect to the local Gateway Service instead of choosing from a list. This way, your client can bypass an extra network hop. In case a service is resolving another service partition in the same cluster, then it is recommended that you use Local FabricClient, as it enables automatic load balancing and improves performance.

public FabricClient (System.Fabric.FabricClientSettings settings);
new System.Fabric.FabricClient : System.Fabric.FabricClientSettings -> System.Fabric.FabricClient
Public Sub New (settings As FabricClientSettings)

Parameters

settings
FabricClientSettings

The fabric client settings used by the fabric client.

Applies to

FabricClient(String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses. These host-endpoints are list of ':' delimited strings where the first part is the ip of the cluster and the second part is the client-connection endpoint-port.

public FabricClient (params string[] hostEndpoints);
new System.Fabric.FabricClient : string[] -> System.Fabric.FabricClient
Public Sub New (ParamArray hostEndpoints As String())

Parameters

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Applies to

FabricClient(FabricClientSettings, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses and the desired FabricClientSettings.

public FabricClient (System.Fabric.FabricClientSettings settings, params string[] hostEndpoints);
new System.Fabric.FabricClient : System.Fabric.FabricClientSettings * string[] -> System.Fabric.FabricClient
Public Sub New (settings As FabricClientSettings, ParamArray hostEndpoints As String())

Parameters

settings
FabricClientSettings

The fabric client settings.

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Applies to

FabricClient(SecurityCredentials, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses and SecurityCredentials.

public FabricClient (System.Fabric.SecurityCredentials credential, params string[] hostEndpoints);
new System.Fabric.FabricClient : System.Fabric.SecurityCredentials * string[] -> System.Fabric.FabricClient
Public Sub New (credential As SecurityCredentials, ParamArray hostEndpoints As String())

Parameters

credential
SecurityCredentials

SecurityCredentials defines the security settings for theFabricClient.

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Applies to

FabricClient(TimeSpan, String[])

Caution

Deprecated

DEPRECATED. Initializes a new instance of the FabricClient class with given keepAliveInterval and Service Fabric Gateway addresses (hostEndpoints).

[System.Obsolete("Deprecated", true)]
public FabricClient (TimeSpan keepAliveInterval, params string[] hostEndpoints);
[<System.Obsolete("Deprecated", true)>]
new System.Fabric.FabricClient : TimeSpan * string[] -> System.Fabric.FabricClient
Public Sub New (keepAliveInterval As TimeSpan, ParamArray hostEndpoints As String())

Parameters

keepAliveInterval
TimeSpan

Defines the periodic keep alive message interval.

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Attributes

Remarks

If there are external devices in between the connection from the client to the cluster that require periodic messages to keep the connection alive, then make sure to use the KeepAlive feature of FabricClient. During the initialization of the FabricClient, users can specify a TimeSpan keepAliveInterval. If this argument is specified, then the FabricClient will periodically ping the Service Fabric Gateway Service it is currently communicating with, as long as there is a pending operation. An example of a scenario where this feature is useful is Windows Azure. If the FabricClient is outside of Windows Azure and the cluster is inside of Windows Azure, then all connections will go through the Azure Load Balancer (ALB). ALB terminates connections that are idle for more than 60 seconds. Hence, in these situations, FabricClient should be created with KeepAliveInterval set to <59 seconds (20 -30 is recommended).

Applies to

FabricClient(SecurityCredentials, FabricClientSettings, String[])

Initializes a new instance of the FabricClient class with given Service Fabric Gateway addresses, SecurityCredentials and FabricClientSettings.

public FabricClient (System.Fabric.SecurityCredentials credential, System.Fabric.FabricClientSettings settings, params string[] hostEndpoints);
new System.Fabric.FabricClient : System.Fabric.SecurityCredentials * System.Fabric.FabricClientSettings * string[] -> System.Fabric.FabricClient
Public Sub New (credential As SecurityCredentials, settings As FabricClientSettings, ParamArray hostEndpoints As String())

Parameters

credential
SecurityCredentials

SecurityCredentials defines the security settings for theFabricClient.

settings
FabricClientSettings

The fabric client settings.

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Applies to

FabricClient(SecurityCredentials, TimeSpan, String[])

Caution

Deprecated

DEPRECATED. Initializes a new instance of the FabricClient class with given credentials, keepAliveInterval and Service Fabric Gateway addresses (hostEndpoints).

[System.Obsolete("Deprecated", true)]
public FabricClient (System.Fabric.SecurityCredentials credential, TimeSpan keepAliveInterval, params string[] hostEndpoints);
[<System.Obsolete("Deprecated", true)>]
new System.Fabric.FabricClient : System.Fabric.SecurityCredentials * TimeSpan * string[] -> System.Fabric.FabricClient
Public Sub New (credential As SecurityCredentials, keepAliveInterval As TimeSpan, ParamArray hostEndpoints As String())

Parameters

credential
SecurityCredentials

Defines the security credentials.

keepAliveInterval
TimeSpan

Defines the periodic keep alive message interval.

hostEndpoints
String[]

Defines the set of Gateway addresses the FabricClient can use to connect to the cluster.

Attributes

Remarks

If there are external devices in between the connection from the client to the cluster that require periodic messages to keep the connection alive, then make sure to use the KeepAlive feature of FabricClient. During the initialization of the FabricClient, users can specify a TimeSpan keepAliveInterval. If this argument is specified, then the FabricClient will periodically ping the Service Fabric Gateway Service it is currently communicating with, as long as there is a pending operation. An example of a scenario where this feature is useful is Windows Azure. If the FabricClient is outside of Windows Azure and the cluster is inside of Windows Azure, then all connections will go through the Azure Load Balancer (ALB). ALB terminates connections that are idle for more than 60 seconds. Hence, in these situations, FabricClient should be created with KeepAliveInterval set to <59 seconds (20 -30 is recommended).

Applies to