spring_cloud icon indicating copy to clipboard operation
spring_cloud copied to clipboard

Spring Cloud 使用总结

如果您觉得本代码对您有所帮助,请点击页面右上方"Star"鼓励一下作者,谢谢

说明

Spring Cloud 的各种Demo的博客地址如下:

公共工程

  • cloud-parent:父工程
  • cloud-registration-center: 注册中心服务:提供服务的注册和发现
    • 当前服务注册的信息:http://127.0.0.1:10761/
    • 服务信息:http://127.0.0.1:10761/health
    • http://127.0.0.1:10761/info
  • cloud-config-center:配置服务中心:提供公共配置读取服务
    • 默认地址:
      • 返回服务器的环境变量:http://127.0.0.1:10888/env
      • 查看服务器的信息:http://127.0.0.1:10888/health
      • 返回所有的当前线程:http://127.0.0.1:10888/dump
    • 查看Native配置
      • http://127.0.0.1:10888/cloud-config-dev.properties
      • http://127.0.0.1:10888/cloud-config-test.properties

以下相关工程相关内容:hystrix、hystrix dashboard、feign配置线程池

简单的demo

介绍springcloud用法

  • cloud-parent 定义公共的POM.XML
  • cloud-config-git 存储配置文件,用于配置中心通过git方式读取数据

cloud-service

服务提供者 测试地址:

  • 无参请求:http://127.0.0.1:10082/simple
  • 带单个参数请求:http://127.0.0.1:10082/simplewithoneparam/{transparentString}
  • 带多个参数请求:http://127.0.0.1:10082//simplewithqry post

cloud-consumer

服务消费者 测试地址:

  • 无参请求:http://127.0.0.1:10701/feign-client-call
  • 带单个参数请求:http://127.0.0.1:10701/feign-client-call/transparentString
  • 带多个参数请求:http://127.0.0.1:10701/feign-client-call-with-qry

cloud-ribbon

  • ribbon用法