日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

spring-boot-admin 2.0小试牛刀

發布時間:2025/3/15 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 spring-boot-admin 2.0小试牛刀 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

為什么80%的碼農都做不了架構師?>>> ??

本文主要展示下spring-boot-admin 2.0版本的新特性

server實例

maven

<dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-server</artifactId><version>2.0.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-webflux</artifactId></dependency><dependency><groupId>org.jolokia</groupId><artifactId>jolokia-core</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency>

配置

spring:application:name: spring-boot-admin-server eureka:instance:preferIpAddress: trueleaseRenewalIntervalInSeconds: 10client:registryFetchIntervalSeconds: 5serviceUrl:defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/management:endpoints:web:exposure:include: "*"endpoint:health:show-details: ALWAYS

config

@Configuration @EnableAutoConfiguration @EnableAdminServer public class AdminServerApplication {public static void main(String[] args) {SpringApplication.run(AdminServerApplication.class, args);} }

client實例

maven

<dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-client</artifactId><version>2.0.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.jolokia</groupId><artifactId>jolokia-core</artifactId></dependency>

配置

spring:boot:admin:client:url: http://localhost:8080

這里配置admin server的地址

運行實例

wallboard

wallboard 實例詳情

applications

journal

小結

新版前端改用vue.js進行了重構,后端的話,使用event sourcing的原則進行了重構,支持spring5,移除了spring-cloud-starter依賴,另外使用WebClient替代了zuul等等,具體詳見spring-boot-admin-changes-with-2-x。

對于client端來說,目前還不能像1.x版本那樣依靠Spring Cloud Discovery進行自動注冊,目前需要使用spring-boot-admin-starter-client。

doc

  • spring-boot-admin-changes-with-2-x
  • spring-boot-admin/releases/tag/2.0.0

轉載于:https://my.oschina.net/go4it/blog/1816348

總結

以上是生活随笔為你收集整理的spring-boot-admin 2.0小试牛刀的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。