类 RpcClientFactory

java.lang.Object
com.alibaba.nacos.common.remote.client.RpcClientFactory

public class RpcClientFactory extends Object
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
  • 构造器详细资料

    • RpcClientFactory

      public RpcClientFactory()
  • 方法详细资料

    • getAllClientEntries

      public static Set<Map.Entry<String,RpcClient>> 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

      public static RpcClient getClient(String clientName)
    • 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

      public static RpcClient createClient(String clientName, ConnectionType connectionType, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String,String> labels)
    • 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 size
      threadPoolMaxSize - grpc thread pool max size
      tlsConfig - 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.