Commit 85a44714 authored by XCQi's avatar XCQi

模拟慢请求接口

parent 763ea95f
...@@ -18,24 +18,19 @@ public class RestApi { ...@@ -18,24 +18,19 @@ public class RestApi {
@GetMapping("/hello") @GetMapping("/hello")
public String hello(){ public String hello(){
return "hello1"; return "hello from fast server";
} }
@GetMapping("/hello1") // @GetMapping("/hello2")
public String hello1(){ // public String hello2(){
return "hello1"; // System.out.println(Thread.currentThread().getName());
} // try {
// Thread.sleep(500);
@GetMapping("/hello2") // } catch (InterruptedException e) {
public String hello2(){ // e.printStackTrace();
System.out.println(Thread.currentThread().getName()); // }
try { // return "hello2";
Thread.sleep(500); // }
} catch (InterruptedException e) {
e.printStackTrace();
}
return "hello2";
}
@GetMapping("/exampleforget") @GetMapping("/exampleforget")
public User getUser() { public User getUser() {
......
spring.application.name=spring-cloud-server-HelloWorld server.port=8080
server.tomcat.max-threads=10
spring.application.name=spring-cloud-server-HelloWorldFast
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
eureka.client.service-url.defaultZone=http://localhost:8761/eureka/ eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
eureka.client.healthcheck.enabled=true eureka.client.healthcheck.enabled=true
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment