https://github.com/ejunjsh/spring-cloud-code
some code for me to practice the spring-cloud
https://github.com/ejunjsh/spring-cloud-code
Last synced: 3 months ago
JSON representation
some code for me to practice the spring-cloud
- Host: GitHub
- URL: https://github.com/ejunjsh/spring-cloud-code
- Owner: ejunjsh
- License: mit
- Created: 2018-09-29T07:12:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-10T04:45:08.000Z (over 6 years ago)
- Last Synced: 2024-12-29T08:41:55.838Z (4 months ago)
- Language: Java
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spring-cloud-code
something code for me to practice the spring-cloud
## precondition
sh mvn.sh
sudo docker-compose up
above command will launch a cluster that consist of one eureka server,two providers,one consumer,one config server and one config client## spring-cloud-config
you can check config client service `http://[docker host ip]:9200/` to see if it get config from config server
## spring-cloud-eureka
you can check `http://[docker host ip]:9001/eureka` to see the eureka cluster.
you can check consumer service `http://[docker host ip]:9003/hello` and you will see below
hello world and this is from eureka-provider-2
refresh againhello world and this is from eureka-provider-1
consumer balances the requests to providers## spring-cloud-hystrix
visit `http://[docker host ip]:9003/hystrix/error`,`http://[docker host ip]:9003/hystrix/timeout` and `http://[docker host ip]:9003/hystrix/nonresponse`
you will see
````
server have been crash, try again later.
````above three links show hystrix can deal with exception,timeout and wrong backend server response in hystrix method,
details in [HystrixTestController.java](https://github.com/ejunjsh/spring-cloud-code/blob/master/spring-cloud-eureka-consumer/src/main/java/com/sky/code/springcloudeureka/consumer/controller/HystrixTestController.java)