环境准备
下载镜像
docker pull chaosbladeio/chaosblade-demo
启动镜像
docker run -it --privileged chaosbladeio/chaosblade-demo
测试场景
Dubbo服务超时
准备
使用前测试dubbo demo是否正常
time curl http://localhost:8080/dubbo/hello?name=dubbo
故障注入测试
- 准备阶段,由于 Java 应用的故障注入是通过 Java Agent 机制实现,所以首先要先挂载 agent
blade prepare jvm --process business
2. 执行阶段,注入故障。即对 B 服务提供方提供的
com.example.demo.DemoService#sayhello 服务注入 3 秒延迟。
blade create dubbo delay --time 3000 --service com.example.service.DemoService --methodname sayHello --consumer
验证Dubbo服务超时
返回延时为1s,与期待的不负,还待查明。
time curl http://localhost:8080/dubbo/hello?name=dubbo
场景恢复
blade destroy 8e56845dfb7b37b7