Library Search
结果页SpringBoot 限流与熔断降级实战
在 知识库 中找到 8 个匹配结果。
知识库
知识库
8 个 SpringBoot 限流与熔断降级实战 ## 目标
演示 Spring Boot 应用接入 Sentinel,实现 QPS 限流 + 熔断降级 + 自定义 fallback,通过控制台实时下发规则。
## 完整代码
### 1. pom.xml
```xml
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-sta… 3% SpringBoot 服务注册与动态配置实战 ## 目标
演示 Spring Boot 应用接入 Nacos,实现服务注册发现 + 动态配置热更新。启动两个实例后,通过 Nacos 控制台修改配置,应用无需重启即可生效。
## 完整代码
### 1. pom.xml 依赖
```xml
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>sprin… 2% Sentinel 流量治理入门:限流熔断实战 ```
请求 → NodeSelectorSlot → ClusterBuilderSlot → StatisticSlot
→ AuthoritySlot → SystemSlot → FlowSlot → DegradeSlot
→ 业务方法
```
---
## 第三章:限流算法详解
### 3.1 滑动窗口
Sentinel 默认使用滑动窗口算法做统计:
```… 2% Dubbo RPC 微服务治理入门 | 维度 | Dubbo | Spring Cloud (Feign) | gRPC |
|------|-------|----------------------|------|
| 通信协议 | TCP 二进制 | HTTP/1.1 + JSON | HTTP/2 + Protobuf |
| 性能 | 高 | 中 | 高 |
| 跨语言 | 中等(Go/Rust) | 天然 HTTP |… 2% 微服务架构设计指南 @GetMapping("/users/{id}")
UserDto getUser(@PathVariable Long id);
@PostMapping("/users")
UserDto create(@RequestBody CreateUserRequest request);
@GetMapping("/users")
Page<UserD… 2% NestJS 毕设实战 — 企业级架构入门 # NestJS 毕设实战 — 企业级架构入门
## 前言
如果你想让毕设代码看起来「专业」,NestJS 是最佳选择。它的模块化、依赖注入、装饰器风格让代码整洁且可测试。面试时拿出 NestJS 项目,面试官会眼前一亮。
## 第一章:理解依赖注入(DI)
NestJS 的核心是 **IoC 容器**(控制反转)。你不需要手动 `new` 对象,容器自动帮你组装:
```typescri… 1% Dubbo 服务提供者与消费者完整示例 @SpringBootApplication
@EnableDubbo
public class ConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(ConsumerApplication.class, args);
}
}
```
## 运行步骤… 1% 微服务调用链:Gateway + Feign + Resilience4j ```java
// 启用 Feign + CircuitBreaker
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class OrderServiceApplication { ... }
```
### 4. API Gateway(网关 8080)
```java
@SpringB… 1%