zhangdaiscott / SpringCloudAll

学习 Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2

Home Page:http://www.jeecg.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

测试请求

# 服务端生产者接口(启动多实例)
http://localhost:8061/echo/123
http://localhost:8061/actuator | 服务端点检查
http://localhost:8061/actuator/nacos-discovery | 服务端点检查
## 服务端_多实例测试
http://localhost:8062/echo/123 [修改nacos配置端口,启动多实例]
http://localhost:8063/echo/123 [修改nacos配置端口,启动多实例]


# 客户端消费者接口
http://localhost:8071/cust/echo/feign
http://localhost:8071/cust/echo/restTemplate
## 客户端_多实例测试
http://localhost:8072/cust/echo/feign [修改端口,启动多实例]
http://localhost:8073/cust/echo/feign [修改端口,启动多实例]


# Gateway(需传递 Head参数 => Authorization:{任意值})
http://localhost:9999/echo/22

# SpringAdmin
http://localhost:9112

# Security
http://localhost:9111/user
(admin/123456)

官方文档

参考文献

技巧与工具

About

学习 Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2

http://www.jeecg.com


Languages

Language:Java 100.0%