public synchronized <T> T getService(Class<T> clazz,
            BrokerInfo brokerInfo,
            RpcConfig config) {
        String serviceKey = getServiceKey(brokerInfo.getBrokerAddr(), clazz.getName());
        ServiceHolder h = servicesCache.get(serviceKey);
        if (h != null) {
            updateTime.put(serviceKey, System.currentTimeMillis());
            return (T) h.getService();
        }
        RpcServiceInvoker invoker =
                new RpcServiceInvoker(clientFactory, clazz, config,
                        new NodeAddrInfo(brokerInfo.getHost(), brokerInfo.getPort(), brokerInfo.getBrokerAddr()));
        Object service =
                Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, invoker);
        servicesCache.put(serviceKey, new ServiceHolder(service, invoker));
        updateTime.put(serviceKey, System.currentTimeMillis());
        return (T) service;
    }
Get broker's service

@param clazz        the class object
@param brokerInfo   the broker object
@param config       the configure
@return             the service instance for the broker
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corerpc/RpcServiceFactory.java