整合dubbo3.0和sentinel,并给出sentinel的限流和熔断例子
觉得有用的朋友请帮忙点个♥♥♥star♥♥♥
一、linux环境下载sentinel
wget https://github.com/alibaba/Sentinel/releases/download/1.8.4/sentinel-dashboard-1.8.4.jar
二、启动sentinel
java -jar sentinel-dashboard-1.8.4.jar --server.port=8010 --auth.username=sentinel --auth.password=sentinel &
三、访问sentinel,ip换成实际的
地址 http://127.0.0.1:8010/#/login
账号/密码 sentinel/sentinel
四、启动dubbo3.0-sentinel项目
1、启动DubboProviderApplication
2、启动DubboConsumerApplication
注意:dubbo.registry.address = zookeeper://192.168.240.132:2181
ip换成实际的地址
五、分别调用限流和熔断接口一次
调用链接如下:
限流:http://127.0.0.1:9091/useExecutes/beyond
熔断:http://127.0.0.1:9091/useFuse/beyond
八、疯狂调用限流和熔断服务,查看限流和熔断结果 调用链接如下:
限流:http://127.0.0.1:9091/useExecutes/beyond