Skip to content

Commit

Permalink
opt 获取dubbo register配置,改为从环境变量中读取
Browse files Browse the repository at this point in the history
  • Loading branch information
lipan committed Nov 3, 2022
1 parent deecab2 commit edcd19c
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lattice-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lattice-model</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion lattice-remote/lattice-remote-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-remote</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

/**
Expand All @@ -20,6 +22,8 @@ public class LatticeRemoteClientProperties implements InitializingBean {
@Setter
private String registryAddress;

@Autowired
private Environment environment;

private LatticeRemoteClientProperties() {

Expand All @@ -28,18 +32,12 @@ private LatticeRemoteClientProperties() {
@Override
public void afterPropertiesSet() throws Exception {
instance = this;
registryAddress = ApplicationProperties.getValueString("lattice.remote.registry.address");
registryAddress = environment.getProperty("lattice.remote.registry.address");
if (StringUtils.isEmpty(registryAddress)) {
registryAddress = ApplicationProperties.getValueString("dubbo.registry.address");
registryAddress = environment.getProperty("dubbo.registry.address");
}
if (StringUtils.isEmpty(registryAddress)) {
String value = ApplicationProperties.getValueString("spring.cloud.nacos.config.server-addr");
if (StringUtils.isNotEmpty(value)) {
registryAddress = "nacos://" + value;
}
}
if (StringUtils.isEmpty(registryAddress)) {
String value = BootstrapProperties.getValueString("spring.cloud.nacos.config.server-addr");
String value = environment.getProperty("spring.cloud.nacos.config.server-addr");
if (StringUtils.isNotEmpty(value)) {
registryAddress = "nacos://" + value;
}
Expand Down
2 changes: 1 addition & 1 deletion lattice-remote/lattice-remote-container/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-remote</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-remote-runner</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion lattice-remote/lattice-remote-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-remote</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion lattice-remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion lattice-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion lattice-tools/lattice-dynamic-loading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-tools</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion lattice-tools/lattice-load-config-res/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-tools</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-maven-build</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-maven-build</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion lattice-tools/lattice-maven-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice-tools</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion lattice-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>lattice</artifactId>
<groupId>org.hiforce.lattice</groupId>
<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
Expand Down
17 changes: 14 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<url>https://github.com/hiforce/lattice</url>
<inceptionYear>2022</inceptionYear>

<version>1.0.12</version>
<version>1.0.12.1-SNAPSHOT</version>
<properties>
<version.lattice>1.0.12</version.lattice>
<version.lattice>1.0.12.1-SNAPSHOT</version.lattice>
<version.spring>5.3.23</version.spring>
<version.spring.boot>2.7.4</version.spring.boot>
<springext-plugin-version>1.2</springext-plugin-version>
Expand Down Expand Up @@ -180,7 +180,18 @@
</dependency>
</dependencies>
</dependencyManagement>

<distributionManagement>
<repository>
<id>quadtalent-quadtalent-release</id>
<name>release</name>
<url>https://quadtalent-maven.pkg.coding.net/repository/quadtalent/release/</url>
</repository>
<snapshotRepository>
<id>quadtalent-quadtalent-snapshot</id>
<name>snapshot</name>
<url>https://quadtalent-maven.pkg.coding.net/repository/quadtalent/snapshot/</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>hiforce</id>
Expand Down

0 comments on commit edcd19c

Please sign in to comment.