summaryrefslogtreecommitdiff
path: root/groot-common
diff options
context:
space:
mode:
authorhoujinchuan <[email protected]>2023-11-17 17:18:31 +0800
committerhoujinchuan <[email protected]>2023-11-17 17:18:31 +0800
commitd473b5ef260ba47a8edc1b60be250057a1e49fda (patch)
treef0eb37505c3796b4d7d3068f8ae3500fcda1fd94 /groot-common
parent3b18347250767197f1f6c932d8a71a29ab2400b7 (diff)
[Improve][connectors]ipfix collector同时支持nacos和consul服务发现
Diffstat (limited to 'groot-common')
-rw-r--r--groot-common/pom.xml6
-rw-r--r--groot-common/src/main/java/com/geedgenetworks/common/config/commonConfig.java8
-rw-r--r--groot-common/src/main/resources/groot.yaml7
3 files changed, 20 insertions, 1 deletions
diff --git a/groot-common/pom.xml b/groot-common/pom.xml
index b384ad6..89a3381 100644
--- a/groot-common/pom.xml
+++ b/groot-common/pom.xml
@@ -67,6 +67,12 @@
</dependency>
<dependency>
+ <groupId>com.ecwid.consul</groupId>
+ <artifactId>consul-api</artifactId>
+ <version>1.4.5</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-shaded-hadoop-2</artifactId>
<exclusions>
diff --git a/groot-common/src/main/java/com/geedgenetworks/common/config/commonConfig.java b/groot-common/src/main/java/com/geedgenetworks/common/config/commonConfig.java
index ea0373b..0ce9315 100644
--- a/groot-common/src/main/java/com/geedgenetworks/common/config/commonConfig.java
+++ b/groot-common/src/main/java/com/geedgenetworks/common/config/commonConfig.java
@@ -47,6 +47,14 @@ public class commonConfig {
GrootYamlParser.getStringProperty("nacos.group", yamlData);
public static final long NACOS_READ_TIMEOUT =
GrootYamlParser.getIntProperty("nacos.read_timeout", yamlData);
+
+ public static final String CONSUL_SERVER_ADDR =
+ GrootYamlParser.getStringProperty("consul.server_addr", yamlData);
+ public static final int CONSUL_SERVER_PORT =
+ GrootYamlParser.getIntProperty("consul.server_port", yamlData);
+ public static final String CONSUL_TOKEN =
+ GrootYamlParser.getStringProperty("consul.token", yamlData);
+
public static final String HOS_TOKEN = GrootYamlParser.getStringProperty("hos.token", yamlData);
public static final int KNOWLEDGE_FILE_CHECK_NUMBER =
GrootYamlParser.getIntProperty("knowledge.file_check_number", yamlData);
diff --git a/groot-common/src/main/resources/groot.yaml b/groot-common/src/main/resources/groot.yaml
index c64ee82..a5bc3f9 100644
--- a/groot-common/src/main/resources/groot.yaml
+++ b/groot-common/src/main/resources/groot.yaml
@@ -3,11 +3,16 @@ nacos:
server_addr: 192.168.44.12:8848
username: nacos
password: nacos
- namespace:
+ namespace: test
data_id: knowledge_base.json
group: DEFAULT_GROUP
read_timeout: 5000
+consul:
+ server_addr: 192.168.41.30
+ server_port: 8500
+ token: c989b503-1d74-f49c-5698-e90fe461e938
+
hos:
token: c21f969b5f03d33d43e04f8f136e7682