From e11153aa12fc5ece60099c433b5da5b5cd7e9190 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Tue, 1 Mar 2022 21:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A4=BA=E4=BE=8B=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=93=E6=9E=84.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.gitignore | 0 .../pom.xml | 48 +++++++++++++++++++ .../Hippo4jCoreApolloExampleApplication.java | 13 +++++ .../src/main/resources/application.yaml | 41 ++++++++++++++++ ...ingBootStarterExampleApplicationTests.java | 13 +++++ .../.gitignore | 33 +++++++++++++ .../pom.xml | 0 .../Hippo4jCoreNacosExampleApplication.java} | 6 +-- .../src/main/resources/bootstrap.yaml | 4 +- .../Hippo4jCoreExampleApplicationTests.java | 2 +- hippo4j-example/pom.xml | 4 ++ 11 files changed, 157 insertions(+), 7 deletions(-) rename hippo4j-example/{hippo4j-core-spring-boot-starter-example => hippo4j-core-apollo-spring-boot-starter-example}/.gitignore (100%) create mode 100644 hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml create mode 100644 hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java create mode 100644 hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/application.yaml create mode 100644 hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloSpringBootStarterExampleApplicationTests.java create mode 100644 hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore rename hippo4j-example/{hippo4j-core-spring-boot-starter-example => hippo4j-core-nacos-spring-boot-starter-example}/pom.xml (100%) rename hippo4j-example/{hippo4j-core-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplication.java => hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java} (65%) rename hippo4j-example/{hippo4j-core-spring-boot-starter-example => hippo4j-core-nacos-spring-boot-starter-example}/src/main/resources/bootstrap.yaml (92%) rename hippo4j-example/{hippo4j-core-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/starter => hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos}/Hippo4jCoreExampleApplicationTests.java (83%) diff --git a/hippo4j-example/hippo4j-core-spring-boot-starter-example/.gitignore b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/.gitignore similarity index 100% rename from hippo4j-example/hippo4j-core-spring-boot-starter-example/.gitignore rename to hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/.gitignore diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml new file mode 100644 index 00000000..b0451a9f --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-example + ${revision} + + + hippo4j-core-apollo-spring-boot-starter-example + ${project.artifactId} + + + true + + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + cn.hippo4j + hippo4j-example-core + ${revision} + + + + cn.hippo4j + hippo4j-core-spring-boot-starter + ${revision} + + + + diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java new file mode 100644 index 00000000..29207674 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloExampleApplication.java @@ -0,0 +1,13 @@ +package cn.hippo4j.example.core.apollo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Hippo4jCoreApolloExampleApplication { + + public static void main(String[] args) { + SpringApplication.run(Hippo4jCoreApolloExampleApplication.class, args); + } + +} diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/application.yaml b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/application.yaml new file mode 100644 index 00000000..0725f131 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/main/resources/application.yaml @@ -0,0 +1,41 @@ +server: + port: 8090 + servlet: + context-path: /example + +spring: + profiles: + active: dev + + dynamic: + thread-pool: + enable: true + enable-banner: true + check-state-interval: 3 + notify-platforms: + - platform: 'WECHAT' + secret-key: 1d307bfa-815f-4662-a2e5-99415e947bb8 + - platform: 'DING' + secret-key: 56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55 + apollo: + namespace: xxxx + config-file-type: yml + executors: + - thread-pool-id: 'message-consume' + core-pool-size: 1 + maximum-pool-size: 1 + queue-capacity: 1 + blocking-queue: 'LinkedBlockingQueue' + rejected-handler: 'AbortPolicy' + keep-alive-time: 6691 + allow-core-thread-time-out: true + thread-name-prefix: 'message-consume' + notify: + is-alarm: true + active-alarm: 80 + capacity-alarm: 80 + interval: 8 + receives: + WECHAT: 'xxx' # Fill in the enterprise weChat userId + DING: 'xxx' # phone + diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloSpringBootStarterExampleApplicationTests.java b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloSpringBootStarterExampleApplicationTests.java new file mode 100644 index 00000000..2acad603 --- /dev/null +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/apollo/Hippo4jCoreApolloSpringBootStarterExampleApplicationTests.java @@ -0,0 +1,13 @@ +package cn.hippo4j.example.core.apollo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class Hippo4jCoreApolloSpringBootStarterExampleApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/hippo4j-example/hippo4j-core-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/pom.xml similarity index 100% rename from hippo4j-example/hippo4j-core-spring-boot-starter-example/pom.xml rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/pom.xml diff --git a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplication.java b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java similarity index 65% rename from hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplication.java rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java index 6014386c..e1b92587 100644 --- a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplication.java +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/java/cn/hippo4j/example/core/nacos/Hippo4jCoreNacosExampleApplication.java @@ -1,4 +1,4 @@ -package cn.hippo4j.example.core.starter; +package cn.hippo4j.example.core.nacos; import cn.hippo4j.core.enable.EnableDynamicThreadPool; import org.springframework.boot.SpringApplication; @@ -6,10 +6,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @EnableDynamicThreadPool @SpringBootApplication(scanBasePackages = "cn.hippo4j.example.core") -public class Hippo4jCoreExampleApplication { +public class Hippo4jCoreNacosExampleApplication { public static void main(String[] args) { - SpringApplication.run(Hippo4jCoreExampleApplication.class, args); + SpringApplication.run(Hippo4jCoreNacosExampleApplication.class, args); } } diff --git a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/resources/bootstrap.yaml b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml similarity index 92% rename from hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/resources/bootstrap.yaml rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml index 2937b954..67436a5d 100644 --- a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/main/resources/bootstrap.yaml +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/main/resources/bootstrap.yaml @@ -9,11 +9,9 @@ spring: cloud: nacos: config: - # group: DEFAULT_GROUP password: nacos - server-addr: 192.168.1.5:8848 + server-addr: 127.0.0.1:8848 username: nacos - # namespace: public dynamic: thread-pool: diff --git a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplicationTests.java b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreExampleApplicationTests.java similarity index 83% rename from hippo4j-example/hippo4j-core-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplicationTests.java rename to hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreExampleApplicationTests.java index b37d9389..f30fb716 100644 --- a/hippo4j-example/hippo4j-core-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/starter/Hippo4jCoreExampleApplicationTests.java +++ b/hippo4j-example/hippo4j-core-nacos-spring-boot-starter-example/src/test/java/cn/hippo4j/example/core/nacos/Hippo4jCoreExampleApplicationTests.java @@ -1,4 +1,4 @@ -package cn.hippo4j.example.core.starter; +package cn.hippo4j.example.core.nacos; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/hippo4j-example/pom.xml b/hippo4j-example/pom.xml index d339916b..77acede6 100644 --- a/hippo4j-example/pom.xml +++ b/hippo4j-example/pom.xml @@ -21,6 +21,10 @@ hippo4j-example-core + + hippo4j-core-nacos-spring-boot-starter-example + + hippo4j-core-apollo-spring-boot-starter-example