wenxuan70
1a8974cc07
|
1 year ago | |
---|---|---|
.. | ||
polaris-circuitbreaker-callee-service | 2 years ago | |
polaris-circuitbreaker-callee-service2 | 2 years ago | |
polaris-circuitbreaker-feign-example | 1 year ago | |
polaris-circuitbreaker-gateway-example | 1 year ago | |
polaris-circuitbreaker-resttemplate-example | 1 year ago | |
polaris-circuitbreaker-webclient-example | 1 year ago | |
README-zh.md | 2 years ago | |
README.md | 2 years ago | |
pom.xml | 2 years ago |
README.md
Spring Cloud Polaris Circuitbreaker example
Example Introduction
This example shows how to usespring-cloud-starter-tencent-polaris-circuitbreaker
in Spring Cloud project for its features.
This example contains callee-servicepolaris-circuitbreaker-callee-service
、polaris-circuitbreaker-callee-service2
and caller-servicepolaris-circuitbreaker-feign-example
、polaris-circuitbreaker-gateway-example
、polaris-circuitbreaker-webclient-example
.
Instruction
Configuration
The configuration is as the following shows. {ip} and
{port} are Polaris backend IP address and port number.
spring:
application:
name: ${application.name}
cloud:
polaris:
address: ${ip}:${port}
Launching Example
Launching Polaris Backend Service
Reference to Polaris Getting Started
Launching callee service
Launchingpolaris-circuitbreaker-example/polaris-circuitbreaker-callee-service
、polaris-circuitbreaker-example/polaris-circuitbreaker-callee-service2
Launching caller service
Launching Feign and Verify
Launchingpolaris-circuitbreaker-example/polaris-circuitbreaker-feign-example
.
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/example/service/a/getBServiceInfo/fallbackFromPolaris'
, Verify circuit breaker and fallback from Polaris-server.
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/example/service/a/getBServiceInfo/fallbackFromCode'
, Verify circuit breaker and fallback from code.
Launching RestTemplate and Verify
Launchingpolaris-circuitbreaker-example/polaris-circuitbreaker-resttemplate-example
.
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/example/service/a/getBServiceInfo/fallbackFromPolaris'
, Verify circuit breaker and fallback from Polaris-server.
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/example/service/a/getBServiceInfo/fallbackFromCode'
, Verify circuit breaker and fallback from code.
Launching WebClient and Verify
Launchingpolaris-circuitbreaker-example/polaris-circuitbreaker-webclient-example
。
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/example/service/a/getBServiceInfo'
, Verify circuit breaker and fallback from code.
Launching SCG and Verify
Launchingpolaris-circuitbreaker-example/polaris-circuitbreaker-gateway-example
。
Sending requestcurl --location --request GET 'http://127.0.0.1:48080/polaris-circuitbreaker-callee-service/example/service/b/info'
, Verify circuit breaker and fallback from code.
Changingpolaris-circuitbreaker-example/polaris-circuitbreaker-gateway-example/resources/bootstrap.yml
, delete local fallback and restart, Verify circuit breaker and fallback from Polaris-server.