关联模式
A关联B, 当B流控后,A 的流控规则也生效了
条件
- A 设置高级流控规则,关联 B资源
- B 设置普通流控规则(独立规则)
实例
接口编写
package com.learning.springcloud.order.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("/guanlian")
public class GuanLianController {@RequestMapping("/A")public Object A() { return "hi, A;"; }@RequestMapping("/B")public Object B() { return "hi, B;"; }}
设置流控规则
- /guanlian/A
- /guanlian/B