private ReferenceConfig<GenericService> buildReference(final MetaData metaData, final String namespace) {
        ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
        reference.setGeneric("true");
        reference.setAsync(true);

        reference.setApplication(applicationConfig);
        reference.setRegistry(registryConfig);
        reference.setConsumer(consumerConfig);
        reference.setInterface(metaData.getServiceName());
        // default protocol is dubbo
        reference.setProtocol("dubbo");
        reference.setCheck(false);
        reference.setLoadbalance("gray");

        Map<String, String> parameters = new HashMap<>(2);
        parameters.put("dispatcher", "direct");
        reference.setParameters(parameters);

        String rpcExt = metaData.getRpcExt();
        DubboParam dubboParam = parserToDubboParam(rpcExt);
        if (Objects.nonNull(dubboParam)) {
            if (StringUtils.isNoneBlank(dubboParam.getVersion())) {
                reference.setVersion(dubboParam.getVersion());
            }
            if (StringUtils.isNoneBlank(dubboParam.getGroup())) {
                reference.setGroup(dubboParam.getGroup());
            }
            if (StringUtils.isNoneBlank(dubboParam.getUrl())) {
                reference.setUrl(dubboParam.getUrl());
            }
            if (StringUtils.isNoneBlank(dubboParam.getCluster())) {
                reference.setCluster(dubboParam.getCluster());
            }
            if (StringUtils.isNoneBlank(dubboParam.getLoadbalance())) {
                reference.getParameters().put(Constants.DUBBO_LOAD_BALANCE, dubboParam.getLoadbalance());
            }
            if ("protobuf".equals(dubboParam.getSerialization())) {
                reference.setGeneric(CommonConstants.GENERIC_SERIALIZATION_PROTOBUF);
            }
            // set dubbo sub protocol
            Optional.ofNullable(dubboParam.getProtocol()).ifPresent(reference::setProtocol);
            Optional.ofNullable(dubboParam.getTimeout()).ifPresent(reference::setTimeout);
            Optional.ofNullable(dubboParam.getRetries()).ifPresent(reference::setRetries);
            Optional.ofNullable(dubboParam.getSent()).ifPresent(reference::setSent);
            // methods
            if (CollectionUtils.isNotEmpty(dubboParam.getMethods())) {
                reference.setMethods(new ArrayList<>());
                for (DubboMethodParam dubboMethodParam : dubboParam.getMethods()) {
                    MethodConfig methodConfig = new MethodConfig();
                    methodConfig.setName(dubboMethodParam.getName());
                    methodConfig.setLoadbalance("gray");
                    methodConfig.setRetries(dubboMethodParam.getRetries());
                    methodConfig.setTimeout(dubboMethodParam.getTimeout());
                    methodConfig.setSent(dubboMethodParam.getSent());
                    Map<String, String> methodsParameters = new HashMap<>(1);
                    methodsParameters.put(Constants.DUBBO_LOAD_BALANCE, dubboMethodParam.getLoadbalance());
                    methodConfig.setParameters(methodsParameters);
                    reference.getMethods().add(methodConfig);
                }
            }
        }
        if (StringUtils.isNotBlank(namespace)) {
            RegistryConfig registryConfig = new RegistryConfig();
            registryConfig.setRegister(false);
            if (!this.registryConfig.getAddress().contains(Constants.NAMESPACE)) {
                registryConfig.setAddress(this.registryConfig.getAddress() + "?" + Constants.NAMESPACE + "=" + namespace);
                reference.setRegistry(registryConfig);
            } else {
                String newAddress = this.registryConfig.getAddress().substring(0, this.registryConfig.getAddress().indexOf(Constants.NAMESPACE) + 1) + Constants.NAMESPACE + "=" + namespace;
                registryConfig.setAddress(newAddress);
                reference.setRegistry(registryConfig);
            }
        } else {
            reference.setRegistry(registryConfig);
        }
        return reference;
    }
buildReference param.

@param metaData metaData
@param namespace namespace
@return the reference config
shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java