Browse Source

升级支持seata-1.1.0

test
smallchill 5 years ago
parent
commit
f8ff2fc670
  1. 5
      blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 18
      blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

5
blade-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -117,6 +117,11 @@ public interface LauncherConstant {
*/
String NACOS_MODE = "nacos";
/**
* seata default模式
*/
String DEFAULT_MODE = "default";
/**
* seata group后缀
*/

18
blade-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@ -40,12 +40,7 @@ public class LauncherServiceImpl implements LauncherService {
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
// seata注册
PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName));
PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
// dubbo注册
PropsUtil.setProperty(props, "dubbo.application.name", appName);
PropsUtil.setProperty(props, "dubbo.application.qos.enable", "false");
@ -53,6 +48,17 @@ public class LauncherServiceImpl implements LauncherService {
PropsUtil.setProperty(props, "dubbo.registry.address", "nacos://" + LauncherConstant.nacosAddr(profile));
PropsUtil.setProperty(props, "dubbo.version", AppConstant.APPLICATION_VERSION);
PropsUtil.setProperty(props, "dubbo.scan.base-packages", AppConstant.BASE_PACKAGES);
// seata注册group格式
PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName));
// seata配置服务group
PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE);
// seata注册模式配置
// PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE);
// PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile));
// PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE);
// PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile));
}
}

Loading…
Cancel
Save