You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-cloud-tencent/spring-cloud-tencent-examples/polaris-circuitbreaker-example
Shanyou Yu (Sean Yu) 06fe706dfd
refactor: refactor circuitbreaker (#963)
2 years ago
..
polaris-circuitbreaker-callee-service feature: improve circuit breaker usage (#913) 2 years ago
polaris-circuitbreaker-callee-service2 feature: improve circuit breaker usage (#913) 2 years ago
polaris-circuitbreaker-feign-example fix: adapt for nacos instance (#935) 2 years ago
polaris-circuitbreaker-gateway-example refactor: refactor circuitbreaker (#963) 2 years ago
polaris-circuitbreaker-resttemplate-example fix: adapt for nacos instance (#935) 2 years ago
polaris-circuitbreaker-webclient-example fix: adapt for nacos instance (#935) 2 years ago
README-zh.md Documentation content changes: add circuitbreaker readme (#930) 2 years ago
README.md Documentation content changes: add circuitbreaker readme (#930) 2 years ago
pom.xml feature:add polaris circuit breaker support (#875) 2 years ago

README.md

Spring Cloud Polaris Circuitbreaker example

Example Introduction

This example shows how to usespring-cloud-starter-tencent-polaris-circuitbreakerin Spring Cloud project for its features.

This example contains callee-servicepolaris-circuitbreaker-callee-servicepolaris-circuitbreaker-callee-service2and caller-servicepolaris-circuitbreaker-feign-examplepolaris-circuitbreaker-gateway-examplepolaris-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-servicepolaris-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.