参考:https://blog.csdn.net/vite_s/article/details/54583243
github:https://github.com/dreamhead/moco
用它可以实现:
1、mock返回
2、返回的报文参数化(从请求报文中获取)
3、同步、异步的重定向
收到请求后,可以给别的服务发起自定义请求
实现回调
踩坑:
1、加入响应延时后,压测时发现延时越来越大。看日志只有16个线程在跑。
解决:加大线程数。
Moco uses Netty default thread count which can be set by io.netty.eventLoopThreads as system property.
Try the following command
java -jar -Dio.netty.eventLoopThreads=200 ...