@Override public String health() { // int i = 1/0; return"i am provider2"; } }
执行结果
所有 provider 全部成功:
1 2 3
>curl http://localhost:8081/health >{broadcast.results=[{"ip":"10.220.47.253","port":20880,"data":"i am provider1"},{"ip":"10.220.47.253","port":20881,"data":"i am provider2"}]}|success%
令其中一个 provider 执行除以零:
1 2 3
>curl http://localhost:8081/health >{broadcast.results=[{"ip":"10.220.47.253","port":20880,"data":"i am provider1"},{"ip":"10.220.47.253","port":20881,"exceptionMsg":"/ by zero"}]}|success%