Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state).
Spring Cloud 官方套件可參考下面連結
目前範例使用了
- openjdk:8u201-jdk-alpine3.9
- maven:3.6.2-jdk-11
編譯 Java 服務 webclient、webservice、gateway、eureka、config
make build-allmake up啟動完成後
-
在瀏覽器上開起連結
http://127.0.0.1:88進入 eureka 介面, 可以看到已註冊的服務 -
在瀏覽器上開起連結
http://127.0.0.1:81/neo-config/pro/master可以看到 configneo-config-pro.propertieshttp://127.0.0.1:81/neo-config/test/master可以看到 configneo-config-test.propertieshttp://127.0.0.1:81/neo-config/dev/master可以看到 configneo-config-dev.properties
這邊使用範例 config-repo, 相關配置在
./config/src/main/resources/bootstrap.yml -
在瀏覽器上開起連結
http://127.0.0.1/可以看到 webclient 的 Hello Pagehttp://127.0.0.1/hello可以看到 webservice 的計數器回傳{"message":"Hi there! you are number 1"}
make down清除資料
make clean