Skip to content

Commit

Permalink
Support etcd3 as configuration center (apache#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfudeshi committed May 23, 2019
1 parent c5729fb commit 212001c
Show file tree
Hide file tree
Showing 11 changed files with 430 additions and 5 deletions.
6 changes: 6 additions & 0 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
<artifactId>seata-config-consul</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-config-etcd3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-core</artifactId>
Expand Down Expand Up @@ -433,6 +438,7 @@
<include>io.seata:seata-config-nacos</include>
<include>io.seata:seata-config-zk</include>
<include>io.seata:seata-config-consul</include>
<include>io.seata:seata-config-etcd3</include>
<include>io.seata:seata-discovery-core</include>
<include>io.seata:seata-discovery-consul</include>
<include>io.seata:seata-discovery-eureka</include>
Expand Down
1 change: 1 addition & 0 deletions config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<module>seata-config-nacos</module>
<module>seata-config-zk</module>
<module>seata-config-all</module>
<module>seata-config-etcd3</module>
<module>seata-config-consul</module>
</modules>
</project>
5 changes: 5 additions & 0 deletions config/seata-config-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<artifactId>seata-config-nacos</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-config-etcd3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-config-consul</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public enum ConfigType {
/**
* Consul config type
*/
Consul;
Consul,
/**
* Etcd3 config type
*/
Etcd3;

/**
* Gets type.
Expand Down
5 changes: 4 additions & 1 deletion config/seata-config-core/src/main/resources/registry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ registry {
}

config {
# file、nacos 、apollo、zk、consul
# file、nacos 、apollo、zk、consul、etcd3
type = "file"

nacos {
Expand All @@ -65,6 +65,9 @@ config {
session.timeout = 6000
connect.timeout = 2000
}
etcd3 {
serverAddr = "http://localhost:2379"
}
file {
name = "file.conf"
}
Expand Down
49 changes: 49 additions & 0 deletions config/seata-config-etcd3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 1999-2019 Seata.io Group.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.seata</groupId>
<artifactId>seata-config</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>seata-config-etcd3</artifactId>
<name>seata-config-etcd3 ${project.version}</name>

<dependencies>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-config-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 212001c

Please sign in to comment.