erdengk commented on pull request #2990:
URL: 
https://github.com/apache/incubator-shenyu/pull/2990#issuecomment-1060193456


   hi, @zouchangfu 
   first of all thank you for your willingness to help me.
   
   I want to write integration tests for hystrix. #2985
   So I need to implement hystrix's circuit breaker.
   For example, after the system reaches the maximum number of requests, 
hystrix performs fuse.
   The system will return to the user a ""You have been restricted, please try 
again later!"" prompt.
   
   For example in this file,
   
`shenyu-integrated-test/shenyu-integrated-test-http/src/test/java/org/apache/shenyu/integrated/test/http/combination/SentinelPluginTest.java`
   
   ```java
       @Test
       public void test() throws IOException {
           String selectorAndRulesResult =
                   initSelectorAndRules(PluginEnum.SENTINEL.getName(), "", 
buildSelectorConditionList(), buildRuleLocalDataList(null));
           assertThat(selectorAndRulesResult, is("success"));
   
           Type returnType = new TypeToken<Map<String, Object>>() {
           }.getType();
           Map<String, Object> result = 
HttpHelper.INSTANCE.postGateway(TEST_SENTINEL_PATH, returnType);
           assertNotNull(result);
           assertEquals("pass", result.get("msg"));
           result = HttpHelper.INSTANCE.postGateway(TEST_SENTINEL_PATH, 
returnType);
           assertEquals("You have been restricted, please try again later!", 
result.get("message"));
       }
   
   ```
   SentinelPlugin implements a circuit breaker mechanism. The first request 
will return pass, and then the system will be blown, and a prompt of ""You have 
been restricted, please try again later!" will be returned.
   
   I would like to ask you to give an example, how do I change the SelectorList 
and rule of the hystrix plugin to achieve this circuit breaker mechanism?
   
   
   


-- 
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]


Reply via email to