国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

SpringCloud添加客戶端Eureka Client過程解析

瀏覽:56日期:2023-09-16 13:39:54

1.添加依賴

<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>

2.添加客戶端配置

/src/main/java/resource/application.yml

server: port: 8770eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/spring: application: name: shop-gateway

3.添加啟動類注解

@SpringBootApplication@EnableDiscoveryClientpublic class ShopGatewayApplication { public static void main(String[] args) { SpringApplication.run(ShopGatewayApplication.class, args); }}

4.啟動注冊中心后,再啟動客戶端

訪問地址

http://localhost:8761

如圖:

SpringCloud添加客戶端Eureka Client過程解析

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Spring
相關文章:
主站蜘蛛池模板: 安丘市| 怀柔区| 杭锦后旗| 张家川| 阳春市| 庆元县| 武定县| 于田县| 凌源市| 顺平县| 岳池县| 星座| 泰宁县| 墨脱县| 道真| 普兰店市| 大田县| 林周县| 波密县| 临夏县| 孙吴县| 永清县| 神木县| 革吉县| 安龙县| 富平县| 自贡市| 增城市| 洪泽县| 体育| 巫山县| 沂南县| 元谋县| 平湖市| 宜川县| 昆明市| 二连浩特市| 巴彦淖尔市| 乌兰浩特市| 伊吾县| 定结县|