(四) 创建Hello-Consumer消费者 - Spring Cloud复习笔记

(四) 创建Hello-Consumer消费者 - Spring Cloud学习笔记

1、核心技术选型:

  Maven:3.3.9
  JDK: 1.8.0_144
  spring-boot-starter-parent: 2.0.3.RELEASE
  spring-cloud-dependencies: Finchley.RELEASE

2、项目创建:

  2-1、新建Spring Boot项目

  

  2-2、选择spring boot项目

  

  2-3、填写包信息

  

  2-4、选择模块信息

  

  2-5、选择保存位置

  

  

3、核心代码如下

  3-1、POM截图如下:

  

  3-2、HelloConsumerController代码如下:

  

  3-3、application.properties配置信息如图:

  

 四、项目启动、测试预览

  4-1、查看注册中心是否有消费者信息   

  

  4-2、打开消费者地址,查看调用结果:

  

4、本章代码地址:

https://github.com/verylove/Spring-Cloud-Notes/tree/master/hello-consume

猜你喜欢

转载自www.cnblogs.com/verylove/p/9300810.html