类 RpcClientFactory
java.lang.Object
com.alibaba.nacos.common.remote.client.RpcClientFactory
RpcClientFactory.to support multi client for different modules of usage.
- 版本:
- $Id: RpcClientFactory.java, v 0.1 2020年07月14日 3:41 PM liuzunfei Exp $
- 作者:
- liuzunfei
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static RpcClientcreateClient(String clientName, ConnectionType connectionType, GrpcClientConfig grpcClientConfig) create a rpc client.static RpcClientcreateClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels) static RpcClientcreateClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels, RpcClientTlsConfig tlsConfig) create a rpc client.static RpcClientcreateClient(String clientName, ConnectionType connectionType, Map<String, String> labels) create a rpc client.static RpcClientcreateClient(String clientName, ConnectionType connectionType, Map<String, String> labels, RpcClientTlsConfig tlsConfig) static RpcClientcreateClient(String clientName, ConnectionType connectionType, Map<String, String> labels, Properties properties, RpcClientTlsConfig tlsConfig) create client with properties.static RpcClientcreateClusterClient(String clientName, ConnectionType connectionType, GrpcClientConfig grpcClientConfig) create a cluster rpc client.static RpcClientcreateClusterClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels) Creates an RPC client for cluster communication with custom thread pool settings.static RpcClientcreateClusterClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels, RpcClientTlsConfig tlsConfig) createClusterClient.static RpcClientcreateClusterClient(String clientName, ConnectionType connectionType, Map<String, String> labels) Creates an RPC client for cluster communication with default thread pool settings.static RpcClientcreateClusterClient(String clientName, ConnectionType connectionType, Map<String, String> labels, RpcClientTlsConfig tlsConfig) Creates an RPC client for cluster communication with TLS configuration.static voiddestroyClient(String clientName) shut down client.get all client.static RpcClient
-
构造器详细资料
-
RpcClientFactory
public RpcClientFactory()
-
-
方法详细资料
-
getAllClientEntries
get all client.- 返回:
- client collection.
-
destroyClient
public static void destroyClient(String clientName) throws com.alibaba.nacos.api.exception.NacosException shut down client.- 参数:
clientName- client name.- 抛出:
com.alibaba.nacos.api.exception.NacosException
-
getClient
-
createClient
public static RpcClient createClient(String clientName, ConnectionType connectionType, Map<String, String> labels) create a rpc client.- 参数:
clientName- client name.connectionType- client type.- 返回:
- rpc client.
-
createClient
public static RpcClient createClient(String clientName, ConnectionType connectionType, Map<String, String> labels, RpcClientTlsConfig tlsConfig) -
createClient
public static RpcClient createClient(String clientName, ConnectionType connectionType, Map<String, String> labels, Properties properties, RpcClientTlsConfig tlsConfig) create client with properties.- 返回:
- rpc client.
-
createClient
-
createClient
public static RpcClient createClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels, RpcClientTlsConfig tlsConfig) create a rpc client.- 参数:
clientName- client name.connectionType- client type.threadPoolCoreSize- grpc thread pool core sizethreadPoolMaxSize- grpc thread pool max sizetlsConfig- tlsconfig- 返回:
- rpc client.
-
createClient
public static RpcClient createClient(String clientName, ConnectionType connectionType, GrpcClientConfig grpcClientConfig) create a rpc client.- 参数:
clientName- client name.connectionType- client type.grpcClientConfig- grpc client config.- 返回:
- rpc client.
-
createClusterClient
public static RpcClient createClusterClient(String clientName, ConnectionType connectionType, Map<String, String> labels) Creates an RPC client for cluster communication with default thread pool settings.- 参数:
clientName- The name of the client.connectionType- The type of client connection.labels- Additional labels for RPC-related attributes.- 返回:
- An RPC client for cluster communication.
-
createClusterClient
public static RpcClient createClusterClient(String clientName, ConnectionType connectionType, Map<String, String> labels, RpcClientTlsConfig tlsConfig) Creates an RPC client for cluster communication with TLS configuration.- 参数:
clientName- The name of the client.connectionType- The type of client connection.labels- Additional labels for RPC-related attributes.tlsConfig- TLS configuration for secure communication.- 返回:
- An RPC client for cluster communication with TLS configuration.
-
createClusterClient
public static RpcClient createClusterClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels) Creates an RPC client for cluster communication with custom thread pool settings.- 参数:
clientName- The name of the client.connectionType- The type of client connection.threadPoolCoreSize- The core size of the gRPC thread pool.threadPoolMaxSize- The maximum size of the gRPC thread pool.labels- Additional labels for RPC-related attributes.- 返回:
- An RPC client for cluster communication with custom thread pool settings.
-
createClusterClient
public static RpcClient createClusterClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels, RpcClientTlsConfig tlsConfig) createClusterClient.- 参数:
clientName- client name.connectionType- connectionType.threadPoolCoreSize- coreSize.threadPoolMaxSize- threadPoolSize.labels- tables.tlsConfig- tlsConfig.- 返回:
-
createClusterClient
public static RpcClient createClusterClient(String clientName, ConnectionType connectionType, GrpcClientConfig grpcClientConfig) create a cluster rpc client.- 参数:
clientName- client name.connectionType- client type.grpcClientConfig- grpc client config.- 返回:
- rpc client.
-