|
|
@ -35,11 +35,16 @@ public class DemoLauncherServiceImpl implements LauncherService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
|
|
|
public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
|
|
|
Properties props = System.getProperties(); |
|
|
|
Properties props = System.getProperties(); |
|
|
|
|
|
|
|
// 开启多数据源
|
|
|
|
|
|
|
|
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true"); |
|
|
|
|
|
|
|
// 指定注册配置信息
|
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId("example", profile)); |
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId("example", profile)); |
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP); |
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP); |
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH); |
|
|
|
PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH); |
|
|
|
// 开启多数据源
|
|
|
|
// 指定注册IP
|
|
|
|
PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true"); |
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1");
|
|
|
|
|
|
|
|
// 指定注册端口
|
|
|
|
|
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.port", "8200");
|
|
|
|
// 自定义命名空间
|
|
|
|
// 自定义命名空间
|
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
|
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE);
|
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
|
|
|
|
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE);
|
|
|
|