You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/01/27 07:53:12 UTC
[servicecomb-pack] branch master updated: [SCB 1127] Support alpha
server registering to Spring Cloud Eureka (#395)
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git
The following commit(s) were added to refs/heads/master by this push:
new af991f9 [SCB 1127] Support alpha server registering to Spring Cloud Eureka (#395)
af991f9 is described below
commit af991f96193741f15d8a4b71a5e5488fd3481b4f
Author: Lei Zhang <co...@gmail.com>
AuthorDate: Sun Jan 27 15:53:07 2019 +0800
[SCB 1127] Support alpha server registering to Spring Cloud Eureka (#395)
[SCB-1127] Support alpha server registering to Spring Cloud Eureka
---
alpha/alpha-server/pom.xml | 14 ++++++
.../src/main/resources/application.yaml | 12 ++++-
.../resources/{application.yaml => bootstrap.yaml} | 56 +++-------------------
pom.xml | 5 ++
4 files changed, 36 insertions(+), 51 deletions(-)
diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml
index 14d477d..7a75f7f 100644
--- a/alpha/alpha-server/pom.xml
+++ b/alpha/alpha-server/pom.xml
@@ -50,6 +50,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+ <version>${spring.cloud.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -258,5 +263,14 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>spring-cloud-eureka</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
diff --git a/alpha/alpha-server/src/main/resources/application.yaml b/alpha/alpha-server/src/main/resources/application.yaml
index 28b8c93..bfbb5e7 100644
--- a/alpha/alpha-server/src/main/resources/application.yaml
+++ b/alpha/alpha-server/src/main/resources/application.yaml
@@ -25,7 +25,9 @@ alpha:
spring:
datasource:
initialization-mode: always
-
+ main:
+ allow-bean-definition-overriding: true
+
---
spring:
profiles: ssl
@@ -65,3 +67,11 @@ spring:
properties:
eclipselink:
ddl-generation: none
+
+---
+spring:
+ profiles: spring-cloud-eureka
+eureka:
+ instance:
+ metadataMap:
+ servicecomb-alpha-server: ${alpha.server.host}:${alpha.server.port}
diff --git a/alpha/alpha-server/src/main/resources/application.yaml b/alpha/alpha-server/src/main/resources/bootstrap.yaml
similarity index 52%
copy from alpha/alpha-server/src/main/resources/application.yaml
copy to alpha/alpha-server/src/main/resources/bootstrap.yaml
index 28b8c93..9bcc270 100644
--- a/alpha/alpha-server/src/main/resources/application.yaml
+++ b/alpha/alpha-server/src/main/resources/bootstrap.yaml
@@ -14,54 +14,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-server:
- port: 8090
-
-alpha:
- server:
- host: 0.0.0.0
- port: 8080
-
+info:
+ app:
+ name: ServiceComb Alpha Server
+ description: ServiceComb Alpha Server
spring:
- datasource:
- initialization-mode: always
-
----
-spring:
- profiles: ssl
-alpha:
- server:
- ssl:
- enable: true
- cert: server.crt
- key: server.pem
- mutualAuth: true
- clientCert: client.crt
-
----
-spring:
- profiles: prd
- datasource:
- username: saga
- password: password
- url: jdbc:postgresql://postgresql.servicecomb.io:5432/saga?useSSL=false
- platform: postgresql
- continue-on-error: false
- jpa:
- properties:
- eclipselink:
- ddl-generation: none
-
----
-spring:
- profiles: mysql
- datasource:
- username: saga
- password: password
- url: jdbc:mysql://mysql.servicecomb.io:3306/saga?useSSL=false
- platform: mysql
- continue-on-error: false
- jpa:
- properties:
- eclipselink:
- ddl-generation: none
+ application:
+ name: servicecomb-alpha-server
diff --git a/pom.xml b/pom.xml
index eb15a52..e93c57e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,9 @@
<spring.boot1.version>1.5.17.RELEASE</spring.boot1.version>
<spring.boot2.version>2.1.1.RELEASE</spring.boot2.version>
<spring.boot.version>${spring.boot2.version}</spring.boot.version>
+ <spring.cloud1.version>1.4.6.RELEASE</spring.cloud1.version>
+ <spring.cloud2.version>2.0.2.RELEASE</spring.cloud2.version>
+ <spring.cloud.version>${spring.cloud2.version}</spring.cloud.version>
<java.chassis.version>1.0.0</java.chassis.version>
<akka.version>2.5.14</akka.version>
<rat.version>0.12</rat.version>
@@ -772,12 +775,14 @@
<id>spring-boot-1</id>
<properties>
<spring.boot.version>${spring.boot1.version}</spring.boot.version>
+ <spring.cloud.version>${spring.cloud1.version}</spring.cloud.version>
</properties>
</profile>
<profile>
<id>spring-boot-2</id>
<properties>
<spring.boot.version>${spring.boot2.version}</spring.boot.version>
+ <spring.cloud.version>${spring.cloud2.version}</spring.cloud.version>
</properties>
</profile>
<profile>