1、编写一个API用于**代码中创建的Sentinel限流规则

1.10-Sentinel使用代码创建规则

上述代码为端点 /share/1 创建了一个流控规则,与我们使用Sentinel Dashboard控制台创建是一样的。

2、创建规则

重启内容中心微服务,访问这个创建Sentinel规则的接口,为端点 /share/1创建规则:

创建规则的接口地址:http://localhost:8101/test/crete-rule-by-code 

创建成功后,进入Sentinel Dashboard控制台,可以看到这个规则,如下图所示:

1.10-Sentinel使用代码创建规则

 

相关文章:

  • 2021-12-13
  • 2021-05-19
  • 2021-06-06
  • 2022-01-12
  • 2021-12-02
  • 2021-10-10
  • 2021-09-28
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-09-01
  • 2021-06-18
  • 2021-11-07
  • 2021-12-09
  • 2021-09-09
  • 2021-07-21
相关资源
相似解决方案