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
wenxuan70 1a8974cc07
feat: add dstService path parameter for circuit breaker endpoint (#1159)
1 year ago
..
polaris-circuitbreaker-callee-service docs:update Polaris test environment ip. (#1010) 2 years ago
polaris-circuitbreaker-callee-service2 docs:update Polaris test environment ip. (#1010) 2 years ago
polaris-circuitbreaker-feign-example feat: add dstService path parameter for circuit breaker endpoint (#1159) 1 year ago
polaris-circuitbreaker-gateway-example feat: add dstService path parameter for circuit breaker endpoint (#1159) 1 year ago
polaris-circuitbreaker-resttemplate-example feat: add dstService path parameter for circuit breaker endpoint (#1159) 1 year ago
polaris-circuitbreaker-webclient-example feat: add dstService path parameter for circuit breaker endpoint (#1159) 1 year 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.