@Bean
    public ConfigService nacosConfigService(final NacosConfig nacosConfig) throws Exception {
        Properties properties = new Properties();
        if (Objects.nonNull(nacosConfig.getAcm()) && nacosConfig.getAcm().isEnabled()) {
            properties.put(PropertyKeyConst.ENDPOINT, nacosConfig.getAcm().getEndpoint());
            properties.put(PropertyKeyConst.NAMESPACE, nacosConfig.getAcm().getNamespace());
            properties.put(PropertyKeyConst.ACCESS_KEY, nacosConfig.getAcm().getAccessKey());
            properties.put(PropertyKeyConst.SECRET_KEY, nacosConfig.getAcm().getSecretKey());
        } else {
            properties.put(PropertyKeyConst.SERVER_ADDR, nacosConfig.getUrl());
            if (StringUtils.isNotBlank(nacosConfig.getNamespace())) {
                properties.put(PropertyKeyConst.NAMESPACE, nacosConfig.getNamespace());
            }
            if (Objects.nonNull(nacosConfig.getUsername())) {
                properties.put(PropertyKeyConst.USERNAME, nacosConfig.getUsername());
            }
            if (Objects.nonNull(nacosConfig.getPassword())) {
                properties.put(PropertyKeyConst.PASSWORD, nacosConfig.getPassword());
            }
            if (StringUtils.isNotBlank(nacosConfig.getContextPath())) {
                properties.put(PropertyKeyConst.CONTEXT_PATH, nacosConfig.getContextPath());
            }
        }
        return NacosFactory.createConfigService(properties);
    }
Nacos config service.

@param nacosConfig the nacos config
@return the config service
@throws Exception the exception
shenyu-spring-boot-starter/shenyu-spring-boot-starter-sync-data-center/shenyu-spring-boot-starter-sync-data-nacos/src/main/java/org/apache/shenyu/springboot/starter/sync/data/nacos/NacosSyncDataConfiguration.java