52coder commented on issue #1870:
URL: 
https://github.com/apache/incubator-brpc/issues/1870#issuecomment-1228174728

   @TousakaRin 代码就是使用的example中的例子
   
   
原始代码:https://github.com/52coder/incubator-brpc/tree/master/example/asynchronous_echo_c%2B%2B
   client.cpp修改点:
   
https://github.com/52coder/incubator-brpc/blob/master/example/asynchronous_echo_c%2B%2B/client.cpp#L65
   添加:
   options.enable_circuit_breaker = true;
   L30行修改为rr :
   DEFINE_string(load_balancer, "rr", "The algorithm for load balancing");
   
   
server.cpp在改动前,先编译出来echo_server,然后在[https://github.com/52coder/incubator-brpc/blob/master/example/asynchronous_echo_c%2B%2B/server.cpp#L63前面增加如下代码:
   cntl->SetFailed(brpc::EREQUEST, "Fail to parse request");
   然后编译出二进制echo_server_fail,这里的想法是生成一个100%失败的server触发熔断。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to