zoukankan      html  css  js  c++  java
  • Spring Cloud探路(二) Erueka客户端的建立

    接上篇

    1、pom.xml与上篇一致
    2、新建包及Application启动类
    1. @Configuration
    2. @ComponentScan
    3. @EnableEurekaClient
    4. @EnableAutoConfiguration
    5. @RestController
    6. public class Application {
    7. @RequestMapping(value = "hello",method = RequestMethod.GET)
    8. public String hello(){
    9. return "你好,世界";
    10. }
    11. public static void main(String[] args){
    12. new SpringApplicationBuilder(Application.class).web(true)
    13. .run(args);
    14. }
    15. }
    3、新建application.yml配置文件(我们尝试两种不同的配置)
    1. eureka:
    2. client:
    3. serviceUrl:
    4. defaultZone: http://localhost:1000/eureka/
    1. eureka:
    2. client:
    3. serviceUrl:
    4. defaultZone: http://localhost:1000/eureka/
    5. spring:
    6. application:
    7. name: client-service1
    8. server:
    9. port: 2000
    4、运行,查看之前Erueka服务端的页面
     

     




  • 相关阅读:
    array_merge
    漏斗模型
    3 破解密码,xshell连接
    2-安装linux7
    1-Linux运维人员要求
    17-[模块]-time&datetime
    16-[模块]-导入方式
    Nginx服务器
    15-作业:员工信息表查询
    14-本章总结
  • 原文地址:https://www.cnblogs.com/tilv37/p/6560615.html
Copyright © 2011-2022 走看看