Skip to content

Commit

Permalink
fix circuitbreaker examples (#180)
Browse files Browse the repository at this point in the history
Co-authored-by: fredrikliu <[email protected]>
  • Loading branch information
fredrikliu and fredrikliu authored May 14, 2024
1 parent e90addd commit 5b5a407
Show file tree
Hide file tree
Showing 40 changed files with 211 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hoxton-callee-a
name: hoxton-callee-a
app: hoxton-callee
name: hoxton-callee
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hoxton-callee-a
app: hoxton-callee
template:
metadata:
labels:
app: hoxton-callee-a
app: hoxton-callee
annotations:
polarismesh.cn/javaagent: "true"
polarismesh.cn/javaagentVersion: "1.7.0-RC2"
polarismesh.cn/javaagentFrameworkName: "spring-cloud"
polarismesh.cn/javaagentFrameworkVersion: "hoxton"
spec:
containers:
- image: polarismesh/polaris-javaagent-demo-sc-quickstart-hoxton-callee-a:1.7.0-java8
- image: polarismesh/polaris-javaagent-demo-sc-quickstart-hoxton-callee:1.7.0-java8
imagePullPolicy: Always
name: provider
resources:
Expand All @@ -34,7 +34,7 @@ spec:
command:
- /bin/bash
- -c
- cd /app && java -Dserver.port=65007 -jar main.jar
- cd /app && java -Dserver.port=48083 -jar main.jar
lifecycle:
preStop:
exec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,37 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>quickstart-example</artifactId>
<groupId>com.tencent.cloud</groupId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.7.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quickstart-callee-service-a</artifactId>
<properties>
<spring.cloud.version>Hoxton.SR12</spring.cloud.version>
<spring.cloud.tencent.version>1.14.0-Hoxton.SR12-SNAPSHOT</spring.cloud.tencent.version>
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<slf4j.vesion>1.7.30</slf4j.vesion>
</properties>

<groupId>com.tencent.polaris</groupId>
<artifactId>callee-service-a</artifactId>
<packaging>jar</packaging>
<version>1.7.0</version>
<name>Quickstart Callee Service A</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
Expand Down Expand Up @@ -45,6 +63,16 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
server:
port: 48083
spring:
application:
name: QuickstartCalleeService
# cloud:
# polaris:
# address: grpc://127.0.0.1:8091
# namespace: default
## enabled: true
# discovery:
# enabled: true
# register: true
# contract:
# exposure: true
# report:
# enabled: false
# stat:
# enabled: true
# port: 28083
# # pushgateway:
# # enabled: true
# # address: 127.0.0.1:9091
# config:
# address: grpc://127.0.0.1:8093
# auto-refresh: true
# groups:
# - name: ${spring.application.name}
# files: [ "config/callee.properties" ]
# ratelimit:
# enabled: true
# rejectRequestTipsFilePath: reject-tips.html
# maxQueuingTime: 500
# tencent:
# metadata:
# content:
# label1: value1
# region: huanan
#management:
# endpoints:
# web:
# exposure:
# include:
# - polaris-discovery
# - polaris-ratelimit
# - polaris-config
#label:
# key-value: user:zhangsan
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hoxton-callee-b
name: hoxton-callee-b
app: hoxton-callee-1
name: hoxton-callee-1
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hoxton-callee-b
app: hoxton-callee-1
template:
metadata:
labels:
app: hoxton-callee-b
app: hoxton-callee-1
annotations:
polarismesh.cn/javaagent: "true"
polarismesh.cn/javaagentVersion: "1.7.0-RC2"
polarismesh.cn/javaagentFrameworkName: "spring-cloud"
polarismesh.cn/javaagentFrameworkVersion: "hoxton"
spec:
containers:
- image: polarismesh/polaris-javaagent-demo-sc-quickstart-hoxton-callee-b:1.7.0-java8
- image: polarismesh/polaris-javaagent-demo-sc-quickstart-hoxton-callee-1:1.7.0-java8
imagePullPolicy: Always
name: provider
resources:
Expand All @@ -34,7 +34,7 @@ spec:
command:
- /bin/bash
- -c
- cd /app && java -Dserver.port=65008 -jar main.jar
- cd /app && java -Dserver.port=48084 -jar main.jar
lifecycle:
preStop:
exec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,37 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>quickstart-example</artifactId>
<groupId>com.tencent.cloud</groupId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.7.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quickstart-callee-service-b</artifactId>
<properties>
<spring.cloud.version>Hoxton.SR12</spring.cloud.version>
<spring.cloud.tencent.version>1.14.0-Hoxton.SR12-SNAPSHOT</spring.cloud.tencent.version>
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<slf4j.vesion>1.7.30</slf4j.vesion>
</properties>

<groupId>com.tencent.polaris</groupId>
<artifactId>callee-service-b</artifactId>
<packaging>jar</packaging>
<version>1.7.0</version>
<name>Quickstart Callee Service B</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
server:
port: 48084
spring:
application:
name: QuickstartCalleeService
# cloud:
# polaris:
# address: grpc://127.0.0.1:8091
# namespace: default
# enabled: true
# discovery:
# enabled: true
# register: true
# contract:
# exposure: true
# report:
# enabled: false
# stat:
# enabled: true
# port: 28084
# # pushgateway:
# # enabled: true
# # address: 127.0.0.1:9091
# config:
# address: grpc://127.0.0.1:8093
# auto-refresh: true
# groups:
# - name: ${spring.application.name}
# files: [ "config/callee.properties" ]
# ratelimit:
# enabled: true
# maxQueuingTime: 500
# tencent:
# metadata:
# content:
# label1: value2
# region: huanan
#management:
# endpoints:
# web:
# exposure:
# include:
# - polaris-discovery
# - polaris-ratelimit
# - polaris-config
#label:
# key-value: user2:lisi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
command:
- /bin/bash
- -c
- cd /app && java -Dserver.port=65008 -jar main.jar
- cd /app && java -Dserver.port=48082 -jar main.jar
lifecycle:
preStop:
exec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>quickstart-example</artifactId>
<groupId>com.tencent.cloud</groupId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.7.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quickstart-caller-service</artifactId>
<artifactId>caller-service</artifactId>
<name>Quickstart Caller Service</name>
<properties>
<spring.cloud.version>Hoxton.SR12</spring.cloud.version>
<spring.cloud.tencent.version>1.14.0-Hoxton.SR12-SNAPSHOT</spring.cloud.tencent.version>
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<slf4j.vesion>1.7.30</slf4j.vesion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<version>1.14.0-Hoxton.SR12-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
name: QuickstartCallerService
cloud:
polaris:
address: grpc://106.55.74.24:8091
address: grpc://127.0.0.1:8091
namespace: default
enabled: true
discovery:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tencent.polaris</groupId>
<artifactId>spring-cloud-hoxton-examples</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<artifactId>circuitbreaker-examples</artifactId>
<packaging>pom</packaging>
<modules>
<module>caller-service</module>
<module>callee-service-a</module>
<module>callee-service-b</module>
</modules>

</project>
Loading

0 comments on commit 5b5a407

Please sign in to comment.