项目作者: zhangdaiscott

项目描述 :
学习 Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2
高级语言: Java
项目地址: git://github.com/zhangdaiscott/SpringCloudAll.git
创建时间: 2020-05-24T07:30:57Z
项目社区:https://github.com/zhangdaiscott/SpringCloudAll

开源协议:

下载


SpringCloudAll

Spring Cloud Alibaba 解决方案 —— 学习示例代码

技术体系【知识点】

  • 1、Nacos 服务注册和发现
  • 2、Nacos 统一配置中心
  • 3、熔断降级限流 sentinel
  • 4、feign配合sentinel使用
  • 5、SpringCloud Gateway
  • 6、服务监控 actuator
  • 7、Spring Boot Admin服务监控
  • 8、链路跟踪 skywalking
  • 9、Spring Security集成
  • 10、Spring Security OAuth2集成
  • 11、rabitmq的环境搭建和使用
  • 12、maven多配置环境
  • 13、服务多实例运行
  • 14、分布定时任务 Quartz/XXL-JOB/elastic-job
  • 15、Seata分布式事务
  • 16、Spring Stream
  • 17、分布式文件系统 minio、阿里OSS

常用注解

注解 功能 位置
@EnableDiscoveryClient 启动nacos服务注册发现 启动类
@EnableFeignClients 启动 Feign 启动类
@FeignClient 声明为Feign接口 接口类
@EnableAdminServer Spring Boot Admin Server监控服务端 启动类
@SentinelRestTemplate

环境安装

软件 访问地址 账号 启动
nacos安装 http://localhost:8848/nacos nacos/nacos docker启动容器
sentinel控制台 http://localhost:8080 sentinel/sentinel 启动命令: java -jar sentinel-dashboard-1.6.3.jar 本地目录: D:\JAVA\alibaba-cloud

测试请求

  1. # 服务端生产者接口(启动多实例)
  2. http://localhost:8061/echo/123
  3. http://localhost:8061/actuator | 服务端点检查
  4. http://localhost:8061/actuator/nacos-discovery | 服务端点检查
  5. ## 服务端_多实例测试
  6. http://localhost:8062/echo/123 [修改nacos配置端口,启动多实例]
  7. http://localhost:8063/echo/123 [修改nacos配置端口,启动多实例]
  8. # 客户端消费者接口
  9. http://localhost:8071/cust/echo/feign
  10. http://localhost:8071/cust/echo/restTemplate
  11. ## 客户端_多实例测试
  12. http://localhost:8072/cust/echo/feign [修改端口,启动多实例]
  13. http://localhost:8073/cust/echo/feign [修改端口,启动多实例]
  14. # Gateway(需传递 Head参数 => Authorization:{任意值})
  15. http://localhost:9999/echo/22
  16. # SpringAdmin
  17. http://localhost:9112
  18. # Security
  19. http://localhost:9111/user
  20. (admin/123456)

官方文档

参考文献

技巧与工具