Explorar el Código

data-adapter也加入nacos

xushili hace 1 año
padre
commit
4b17985853

+ 14 - 0
build.gradle

@@ -1,8 +1,14 @@
+
+plugins {
+    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
+}
+
 subprojects {
     apply plugin: "java-library"
     apply plugin: "idea"
     apply plugin: "eclipse"
     apply plugin: "maven-publish"
+    apply plugin: 'io.spring.dependency-management'
 
 
     [compileJava, compileTestJava, javadoc]*.options*.encoding = "UTF-8"
@@ -12,6 +18,14 @@ subprojects {
         all*.exclude module: "spring-boot-starter-logging"
     }
 
+    dependencyManagement {
+        imports {
+            mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
+            mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion"
+            mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:$springCloudAlibabaVersion"
+        }
+    }
+
     dependencies {
         compileOnly("org.projectlombok:lombok:$lombokVersion")
         annotationProcessor("org.projectlombok:lombok:$lombokVersion")

+ 0 - 8
state/wind/build.gradle

@@ -15,14 +15,6 @@ buildscript {
 apply plugin: "$bootGroup"
 apply plugin: 'io.spring.dependency-management'
 
-dependencyManagement {
-    imports {
-        mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
-        mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion"
-        mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:$springCloudAlibabaVersion"
-    }
-}
-
 dependencies {
     implementation project(":common:utils")
     implementation project(":common:data")

+ 3 - 0
timeseries/data-adapter/build.gradle

@@ -47,6 +47,9 @@ dependencies {
     implementation('com.fasterxml.jackson.datatype:jackson-datatype-jdk8')
     //implementation ("com.taosdata.jdbc:taos-jdbcdriver:$taosVersion")
     implementation 'org.postgresql:postgresql:42.4.0'
+    implementation("org.springframework.cloud:spring-cloud-starter-bootstrap")
+    implementation("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery")
+    implementation("com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config")
 
 }
 

+ 48 - 0
timeseries/data-adapter/src/main/resources/bootstrap.yaml

@@ -0,0 +1,48 @@
+server:
+  port: 8011
+  max-http-header-size: 128KB
+  tomcat:
+    connection-timeout: 3000
+
+spring:
+  application:
+    name: data-adapter
+  profiles:
+    active: nx
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 192.168.10.18:8848
+      config:
+        # 配置中心地址
+        server-addr: 192.168.10.18:8848
+        # 配置文件格式
+        file-extension: yml
+        # 共享配置
+        shared-configs:
+          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+  jpa:
+    show-sql: false
+  cache:
+    type: SIMPLE
+  datasource:
+    # -------------------------1区mysql/2区oracle---------------------------------------
+    driver-class-name: oracle.jdbc.OracleDriver
+    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+
+timeseries:
+  db-type: taos